Shelly: Allow setting the roller shutter percentage
This commit is contained in:
parent
d05f21d4c7
commit
2fe97975fe
@ -414,6 +414,15 @@ void IntegrationPluginShelly::executeAction(ThingActionInfo *info)
|
|||||||
return;
|
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;
|
qCWarning(dcShelly()) << "Unhandled execute action call for device" << thing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -901,8 +901,12 @@
|
|||||||
"name": "percentage",
|
"name": "percentage",
|
||||||
"displayName": "Position",
|
"displayName": "Position",
|
||||||
"displayNameEvent": "Position changed",
|
"displayNameEvent": "Position changed",
|
||||||
|
"displayNameAction": "Set position",
|
||||||
"type": "int",
|
"type": "int",
|
||||||
"defaultValue": 0
|
"defaultValue": 0,
|
||||||
|
"minValue": 0,
|
||||||
|
"maxValue": 100,
|
||||||
|
"writable": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"actionTypes": [
|
"actionTypes": [
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user