diff --git a/shelly/integrationpluginshelly.cpp b/shelly/integrationpluginshelly.cpp index 824ce060..4d0132cb 100644 --- a/shelly/integrationpluginshelly.cpp +++ b/shelly/integrationpluginshelly.cpp @@ -414,6 +414,15 @@ void IntegrationPluginShelly::executeAction(ThingActionInfo *info) return; } + if (action.actionTypeId() == shellyRollerPercentageActionTypeId) { + Thing *parentDevice = myThings().findById(thing->parentId()); + MqttChannel *channel = m_mqttChannels.value(parentDevice); + QString shellyId = parentDevice->paramValue(m_idParamTypeMap.value(parentDevice->thingClassId())).toString(); + channel->publish("shellies/" + shellyId + "/roller/0/command/pos", QByteArray::number(action.param(shellyRollerPercentageActionPercentageParamTypeId).value().toInt())); + info->finish(Thing::ThingErrorNoError); + return; + } + qCWarning(dcShelly()) << "Unhandled execute action call for device" << thing; } diff --git a/shelly/integrationpluginshelly.json b/shelly/integrationpluginshelly.json index 83160a1d..c0ffa023 100644 --- a/shelly/integrationpluginshelly.json +++ b/shelly/integrationpluginshelly.json @@ -901,8 +901,12 @@ "name": "percentage", "displayName": "Position", "displayNameEvent": "Position changed", + "displayNameAction": "Set position", "type": "int", - "defaultValue": 0 + "defaultValue": 0, + "minValue": 0, + "maxValue": 100, + "writable": true } ], "actionTypes": [