added possible state fields for autocreated actions -> limits and default value

This commit is contained in:
Simon Stürz 2015-04-07 13:32:36 +02:00 committed by Michael Zanetti
parent 231abee49b
commit e24ed007dd
2 changed files with 7 additions and 4 deletions

View File

@ -241,8 +241,11 @@ QList<DeviceClass> DevicePlugin::supportedDevices() const
if (st.value("writable").toBool()) {
ActionType actionType(st.value("id").toString());
actionType.setName("set " + st.value("name").toString());
// param already checked in StateType
ParamType paramType(st.value("name").toString(), t);
// Note: fields already checked in StateType
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);
actionTypes.append(actionType);
}

View File

@ -24,8 +24,8 @@
{
"name": "button code",
"type": "int",
"minimumValue": 1,
"maximumValue": 16
"minValue": 1,
"maxValue": 16
}
],
"actionTypes": [