mirror of
https://github.com/nymea/nymea-plugins.git
synced 2026-10-27 14:22:44 +01:00
test smth
This commit is contained in:
parent
846ded780e
commit
1141805763
@ -1613,7 +1613,7 @@ void IntegrationPluginShelly::setupGen2(ThingSetupInfo *info)
|
||||
}
|
||||
|
||||
if (info->thing()->thingClassId() == shellyPlus25ThingClassId) {
|
||||
// Make sure the shelly 2.5 is in the mode we expect it to be (roller/cover or relay/switch)
|
||||
// Make sure the shelly plus 2PM is in the mode we expect it to be (roller/cover or relay/switch)
|
||||
bool rollerMode = info->thing()->paramValue("rollerMode").toBool();
|
||||
QVariantMap params;
|
||||
if(rollerMode) {
|
||||
@ -1622,14 +1622,13 @@ void IntegrationPluginShelly::setupGen2(ThingSetupInfo *info)
|
||||
params.insert("name", "switch");
|
||||
}
|
||||
ShellyRpcReply *reply2 = client->sendRequest("Shelly.SetProfile", params);
|
||||
connect(reply2, &ShellyRpcReply::finished, info, [info](ShellyRpcReply::Status status, const QVariantMap &/*response*/){
|
||||
connect(reply2, &ShellyRpcReply::finished, info, [this, info, rollerMode](ShellyRpcReply::Status status, const QVariantMap &/*response*/){
|
||||
if (status != ShellyRpcReply::StatusSuccess) {
|
||||
qCWarning(dcShelly) << "Error during shelly setup";
|
||||
info->finish(Thing::ThingErrorHardwareFailure, QT_TR_NOOP("Unable to configure shelly device."));
|
||||
return;
|
||||
}
|
||||
info->finish(Thing::ThingErrorNoError);
|
||||
});
|
||||
|
||||
qCDebug(dcShelly()) << "***** Child count:" << myThings().filterByParentId(info->thing()->id()).count();
|
||||
if (myThings().filterByParentId(info->thing()->id()).count() == 0) {
|
||||
@ -1656,6 +1655,8 @@ void IntegrationPluginShelly::setupGen2(ThingSetupInfo *info)
|
||||
}
|
||||
emit autoThingsAppeared(children);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user