Shelly: Fix shelly 2.5 roler position
This commit is contained in:
parent
f111b77bc0
commit
82b773c7f7
@ -710,7 +710,7 @@ void IntegrationPluginShelly::executeAction(ThingActionInfo *info)
|
|||||||
url.setPath(QString("/roller/%1").arg(info->thing()->paramValue(shellyRollerThingChannelParamTypeId).toInt() - 1));
|
url.setPath(QString("/roller/%1").arg(info->thing()->paramValue(shellyRollerThingChannelParamTypeId).toInt() - 1));
|
||||||
QUrlQuery query;
|
QUrlQuery query;
|
||||||
query.addQueryItem("go", "to_pos");
|
query.addQueryItem("go", "to_pos");
|
||||||
query.addQueryItem("roller_pos", info->action().paramValue(shellyRollerPercentageActionPercentageParamTypeId).toString());
|
query.addQueryItem("roller_pos", QString::number(100 - info->action().paramValue(shellyRollerPercentageActionPercentageParamTypeId).toUInt()));
|
||||||
url.setQuery(query);
|
url.setQuery(query);
|
||||||
QNetworkReply *reply = hardwareManager()->networkManager()->get(QNetworkRequest(url));
|
QNetworkReply *reply = hardwareManager()->networkManager()->get(QNetworkRequest(url));
|
||||||
connect(reply, &QNetworkReply::finished, reply, &QNetworkReply::deleteLater);
|
connect(reply, &QNetworkReply::finished, reply, &QNetworkReply::deleteLater);
|
||||||
@ -869,7 +869,7 @@ void IntegrationPluginShelly::onMulticastMessageReceived(const QHostAddress &sou
|
|||||||
break;
|
break;
|
||||||
case 1103: // Roller position
|
case 1103: // Roller position
|
||||||
foreach (Thing *roller, myThings().filterByParentId(thing->id()).filterByInterface("extendedshutter")) {
|
foreach (Thing *roller, myThings().filterByParentId(thing->id()).filterByInterface("extendedshutter")) {
|
||||||
roller->setStateValue(shellyRollerPercentageStateTypeId, value.toUInt());
|
roller->setStateValue(shellyRollerPercentageStateTypeId, 100 - value.toUInt());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1105:
|
case 1105:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user