From 2dc23aef77c935dd4ef24208fb973b6819ef18c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Mon, 13 Jul 2026 20:18:16 +0200 Subject: [PATCH] ESPSomfyRTS: Fix step up/down for blinds --- espsomfyrts/integrationpluginespsomfyrts.cpp | 10 +++++++++- espsomfyrts/integrationpluginespsomfyrts.json | 11 +++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/espsomfyrts/integrationpluginespsomfyrts.cpp b/espsomfyrts/integrationpluginespsomfyrts.cpp index e4783bf8..e965fba2 100644 --- a/espsomfyrts/integrationpluginespsomfyrts.cpp +++ b/espsomfyrts/integrationpluginespsomfyrts.cpp @@ -205,8 +205,10 @@ void IntegrationPluginEspSomfyRts::executeAction(ThingActionInfo *info) } QNetworkRequest request(somfy->shadeCommandUrl()); + const QByteArray requestData = QJsonDocument::fromVariant(requestMap).toJson(); request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); - QNetworkReply *reply = hardwareManager()->networkManager()->put(request, QJsonDocument::fromVariant(requestMap).toJson()); + qCDebug(dcESPSomfyRTS()) << "Executing command on" << info->thing() << qUtf8Printable(requestData); + QNetworkReply *reply = hardwareManager()->networkManager()->put(request, requestData); connect(reply, &QNetworkReply::finished, reply, &QNetworkReply::deleteLater); connect(reply, &QNetworkReply::finished, info, [reply, info](){ @@ -260,6 +262,12 @@ void IntegrationPluginEspSomfyRts::executeAction(ThingActionInfo *info) int percentage = calculatePercentageFromAngle(minValue, maxValue, angle); qCDebug(dcESPSomfyRTS()) << "######" << percentage; requestMap.insert("target", percentage); + } else if (action.actionTypeId() == venetianBlindStepUpActionTypeId) { + requestMap.insert("command", EspSomfyRts::getShadeCommandString(EspSomfyRts::ShadeCommandStepUp)); + requestMap.insert("stepSize", thing->setting(venetianBlindSettingsStepSizeParamTypeId).toUInt()); + } else if (action.actionTypeId() == venetianBlindStepDownActionTypeId) { + requestMap.insert("command", EspSomfyRts::getShadeCommandString(EspSomfyRts::ShadeCommandStepDown)); + requestMap.insert("stepSize", thing->setting(venetianBlindSettingsStepSizeParamTypeId).toUInt()); } QNetworkRequest request(url); diff --git a/espsomfyrts/integrationpluginespsomfyrts.json b/espsomfyrts/integrationpluginespsomfyrts.json index 1c5105d0..4bdc628e 100644 --- a/espsomfyrts/integrationpluginespsomfyrts.json +++ b/espsomfyrts/integrationpluginespsomfyrts.json @@ -157,6 +157,17 @@ "type": "uint" } ], + "settingsTypes": [ + { + "id": "ad505c57-6029-40a8-a610-f909e1f61f06", + "name": "stepSize", + "displayName": "Step size", + "type": "uint", + "defaultValue": 1, + "minValue": 1, + "maxValue": 127 + } + ], "stateTypes": [ { "id": "ade34009-bb6c-41fc-86dc-fc59c9cbca2f",