From 82b773c7f7a2e73d42a452585ba9b0405af99675 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Fri, 28 Oct 2022 22:37:18 +0200 Subject: [PATCH] Shelly: Fix shelly 2.5 roler position --- shelly/integrationpluginshelly.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shelly/integrationpluginshelly.cpp b/shelly/integrationpluginshelly.cpp index d49741a7..6cda5cfd 100644 --- a/shelly/integrationpluginshelly.cpp +++ b/shelly/integrationpluginshelly.cpp @@ -710,7 +710,7 @@ void IntegrationPluginShelly::executeAction(ThingActionInfo *info) url.setPath(QString("/roller/%1").arg(info->thing()->paramValue(shellyRollerThingChannelParamTypeId).toInt() - 1)); QUrlQuery query; 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); QNetworkReply *reply = hardwareManager()->networkManager()->get(QNetworkRequest(url)); connect(reply, &QNetworkReply::finished, reply, &QNetworkReply::deleteLater); @@ -869,7 +869,7 @@ void IntegrationPluginShelly::onMulticastMessageReceived(const QHostAddress &sou break; case 1103: // Roller position foreach (Thing *roller, myThings().filterByParentId(thing->id()).filterByInterface("extendedshutter")) { - roller->setStateValue(shellyRollerPercentageStateTypeId, value.toUInt()); + roller->setStateValue(shellyRollerPercentageStateTypeId, 100 - value.toUInt()); } break; case 1105: