Shelly: Allow setting the roller shutter percentage
parent
d05f21d4c7
commit
2fe97975fe
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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": [
|
||||
|
|
|
|||
Loading…
Reference in New Issue