added possible state fields for autocreated actions -> limits and default value
This commit is contained in:
parent
231abee49b
commit
e24ed007dd
@ -241,8 +241,11 @@ QList<DeviceClass> DevicePlugin::supportedDevices() const
|
|||||||
if (st.value("writable").toBool()) {
|
if (st.value("writable").toBool()) {
|
||||||
ActionType actionType(st.value("id").toString());
|
ActionType actionType(st.value("id").toString());
|
||||||
actionType.setName("set " + st.value("name").toString());
|
actionType.setName("set " + st.value("name").toString());
|
||||||
// param already checked in StateType
|
// Note: fields already checked in StateType
|
||||||
ParamType paramType(st.value("name").toString(), t);
|
ParamType paramType(st.value("name").toString(), t, st.value("defaultValue").toVariant());
|
||||||
|
// states don't have allowed values
|
||||||
|
// states don't have input types
|
||||||
|
paramType.setLimits(st.value("minValue").toVariant(), st.value("maxValue").toVariant());
|
||||||
actionType.setParamTypes(QList<ParamType>() << paramType);
|
actionType.setParamTypes(QList<ParamType>() << paramType);
|
||||||
actionTypes.append(actionType);
|
actionTypes.append(actionType);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,8 +24,8 @@
|
|||||||
{
|
{
|
||||||
"name": "button code",
|
"name": "button code",
|
||||||
"type": "int",
|
"type": "int",
|
||||||
"minimumValue": 1,
|
"minValue": 1,
|
||||||
"maximumValue": 16
|
"maxValue": 16
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"actionTypes": [
|
"actionTypes": [
|
||||||
|
|||||||
Reference in New Issue
Block a user