add index, criticalStateTypeId, primary Action/StateType

This commit is contained in:
Simon Stürz 2016-05-13 21:21:04 +02:00 committed by Michael Zanetti
parent 7ecf0cda99
commit a23b3ed46d
26 changed files with 533 additions and 125 deletions

View File

@ -6,11 +6,11 @@
The images used for this examples were created with the Ubuntu SDK and are ment as an example, not as a directive. The images used for this examples were created with the Ubuntu SDK and are ment as an example, not as a directive.
Depending on where a \l{ParamType} will be read there are different methods how to present them to the user. Depending on where a \l{ParamType} will be read there are different methods how to present them to the user.
If you have an \l{Action}, you can check out the \i Actions list to get a feeling how an \l{ActionType} can If you have an \l{Action}, you can check out the \e Actions list to get a feeling how an \l{ActionType} can
be interpreted. be interpreted.
If a user has to fill out a list of \l{Params}{Param} for a \l{Device} setup or configuration, some examples can be found If a user has to fill out a list of \l{Params}{Param} for a \l{Device} setup or configuration, some examples can be found
in the \i Params list. in the \e Params list.
\chapter Actions \chapter Actions
\section2 Without params \section2 Without params

View File

@ -140,6 +140,7 @@
"name": "The name of the device class", "name": "The name of the device class",
"idName": "deviceClassName", "idName": "deviceClassName",
"deviceClassId": "uuid", "deviceClassId": "uuid",
"deviceIcon": "Icon",
"basicTags": [ "basicTags": [
"BasicTag" "BasicTag"
], ],
@ -148,6 +149,9 @@
], ],
"setupMethod": "SetupMethod", "setupMethod": "SetupMethod",
"pairingInfo": "Information how to pair the device.", "pairingInfo": "Information how to pair the device.",
"criticalStateTypeId": "uuid",
"primaryStateTypeId": "uuid",
"primaryActionTypeId": "uuid",
"discoveryParamTypes": [ "discoveryParamTypes": [
], ],
"paramTypes": [ "paramTypes": [
@ -178,6 +182,14 @@
\tt ... \tt ...
\li - \underline{\e deviceIcon:} Defines the icon for this \l{DeviceClass}. See enum \l{DeviceClass::DeviceIcon} for more information. The expected value for the \e deviceIcon parameters matches the enum name like this:
\tt {DeviceClass::DeviceIconBed} \unicode{0x2192} \tt {"deviceIcon": "Bed" }
\tt {DeviceClass::DeviceIconPower} \unicode{0x2192} \tt {"deviceIcon": "Power" }
\tt ...
\li - \underline{\e createMethods:} A list of possible \l{DeviceClass::CreateMethod}{CreateMethods} for this device \unicode{0x2192} \l{DeviceClass::createMethods()}. Some devices can be created in different ways. Possible values are: \li - \underline{\e createMethods:} A list of possible \l{DeviceClass::CreateMethod}{CreateMethods} for this device \unicode{0x2192} \l{DeviceClass::createMethods()}. Some devices can be created in different ways. Possible values are:
\list \list
\li \e user \unicode{0x2192} \l{DeviceClass::CreateMethodUser} \li \e user \unicode{0x2192} \l{DeviceClass::CreateMethodUser}
@ -193,6 +205,9 @@
\endlist \endlist
\note For more information please take a look at \l{CreateMethods and SetupMethods} documentation. \note For more information please take a look at \l{CreateMethods and SetupMethods} documentation.
\li - \underline{\e pairingInfo:} The \l{DeviceClass::pairingInfo()}{pairingInfo} will inform the user how to pair the device \unicode{0x2192} \l{DeviceClass::setupMethod()}. This parameter will only be used for \l{DeviceClass::SetupMethodDisplayPin}{DisplayPin} and \l{DeviceClass::SetupMethodEnterPin}{EnterPin} and \l{DeviceClass::SetupMethodPushButton}{PushButton}. Example: "Please press the button on the device before continue." \li - \underline{\e pairingInfo:} The \l{DeviceClass::pairingInfo()}{pairingInfo} will inform the user how to pair the device \unicode{0x2192} \l{DeviceClass::setupMethod()}. This parameter will only be used for \l{DeviceClass::SetupMethodDisplayPin}{DisplayPin} and \l{DeviceClass::SetupMethodEnterPin}{EnterPin} and \l{DeviceClass::SetupMethodPushButton}{PushButton}. Example: "Please press the button on the device before continue."
\li - \underline{\e criticalStateTypeId:} Optional: Define which \l{StateType} is critical for this \l{Device}. The given \l{StateTypeId} sould refer to a \tt{bool} \l{State} which enables / disables the whole \l{Device} i.e. \e{"connected"}, \e{"available"} or \e{"reachable"}. This allowes a client developer to disable the device until this \l{State} becomes true.
\li - \underline{\e primaryStateTypeId:} Optional: Define which \l{StateType} is the primary \l{State} for this \l{Device}. This allowes a client developer to place the primary \l{State} value in the device overview.
\li - \underline{\e primaryActionTypeId:} Optional: Define which \l{ActionType} is the primary \l{Action} for this \l{Device}. This allowes a client developer to place the primary \l{Action} element in the device overview.
\li - \underline{\e discoveryParamTypes:} A list of \l{ParamType}{ParamTypes} which will be needed for discovering a device \unicode{0x2192} \l{DeviceClass::discoveryParamTypes()}. This parameter will only be used for devices with the \l{DeviceClass::CreateMethodDiscovery}{CreateMethodDiscovery} (see section "\l{The ParamType definition}"). \li - \underline{\e discoveryParamTypes:} A list of \l{ParamType}{ParamTypes} which will be needed for discovering a device \unicode{0x2192} \l{DeviceClass::discoveryParamTypes()}. This parameter will only be used for devices with the \l{DeviceClass::CreateMethodDiscovery}{CreateMethodDiscovery} (see section "\l{The ParamType definition}").
\li - \underline{\e paramTypes:} A list of \l{ParamType}{ParamTypes} which define the paramters of a device \unicode{0x2192} \l{DeviceClass::paramTypes()} (see section "\l{The ParamType definition}"). \li - \underline{\e paramTypes:} A list of \l{ParamType}{ParamTypes} which define the paramters of a device \unicode{0x2192} \l{DeviceClass::paramTypes()} (see section "\l{The ParamType definition}").
\li - \underline{\e stateTypes:} A list of \l{StateType}{StateTypes} of the device \unicode{0x2192} \l{DeviceClass::stateTypes()} (see section "\l{The StateType definition}"). \li - \underline{\e stateTypes:} A list of \l{StateType}{StateTypes} of the device \unicode{0x2192} \l{DeviceClass::stateTypes()} (see section "\l{The StateType definition}").
@ -211,6 +226,7 @@
{ {
"name": "name of the param", "name": "name of the param",
"type": "DataType", "type": "DataType",
"index": "int",
"inputType": "InputType", "inputType": "InputType",
"defaultValue": "The default value which will be used if the param is not given." "defaultValue": "The default value which will be used if the param is not given."
"unit": "The unit of the parameter", "unit": "The unit of the parameter",
@ -219,8 +235,7 @@
"allowedValues": [ "allowedValues": [
"value" "value"
], ],
"readOnly": "bool" "readOnly": "bool"
} }
] ]
} }
@ -229,6 +244,7 @@
\list \list
\li - \underline{\e name:} The visible name of the \l{ParamType} \unicode{0x2192} \l{ParamType::name()}. \li - \underline{\e name:} The visible name of the \l{ParamType} \unicode{0x2192} \l{ParamType::name()}.
\li - \underline{\e type:} The data type of this paramter \unicode{0x2192} \l{ParamType::type()}. \li - \underline{\e type:} The data type of this paramter \unicode{0x2192} \l{ParamType::type()}.
\li - \underline{\e index:} The order index of the \l{ParamType} \unicode{0x2192} \l{ParamType::index()}. This index will be used for sorting the \l{Param}{Params} of a \l{Device}/\l{Action}/\l{Event} to make sure the types looks the same on all clients. Please make sure all \l{ParamType}{ParamTypes} together will create a list from \tt 0 to \tt x.
\li - \underline{\e inputType:} A paramter for clients to know which kind of \l{Types::InputType}{InputType} this. See enum \l{Types::InputType} for more information. The expected value for the \e inputType parameter matches the enum name like this: \li - \underline{\e inputType:} A paramter for clients to know which kind of \l{Types::InputType}{InputType} this. See enum \l{Types::InputType} for more information. The expected value for the \e inputType parameter matches the enum name like this:
\tt {Types::InputTypeTextArea} \unicode{0x2192} \tt {"inputType": "TextArea"} \tt {Types::InputTypeTextArea} \unicode{0x2192} \tt {"inputType": "TextArea"}
@ -357,6 +373,7 @@ This mechanism was created to ensure that the \l{EventType} and \l{ActionType} w
"name": "name of the action", "name": "name of the action",
"idName": "actionName", "idName": "actionName",
"id": "uuid", "id": "uuid",
"index": "int",
"paramTypes": [ "paramTypes": [
... ...
] ]
@ -368,7 +385,8 @@ This mechanism was created to ensure that the \l{EventType} and \l{ActionType} w
\list \list
\li - \underline{\e name:} The visible name of the \l{ActionType} \unicode{0x2192} \l{ActionType::name()}. \li - \underline{\e name:} The visible name of the \l{ActionType} \unicode{0x2192} \l{ActionType::name()}.
\li - \underline{\e idName:} This parameter will be used to define the ActionTypeId variable named <idName>ActionTypeId in the plugininfo.h, so it can be used in the code. \li - \underline{\e idName:} This parameter will be used to define the ActionTypeId variable named <idName>ActionTypeId in the plugininfo.h, so it can be used in the code.
\li - \underline{\e id:} The actual uuid (\l{ActionTypeId}) of the \l{ActionType} \unicode{0x2192} \l{ActionType::id()}. \li - \underline{\e id:} The actual uuid (\l{ActionTypeId}) of the \l{ActionType} \unicode{0x2192} \l{ActionType::id()}.
\li - \underline{\e index:} The order index of the \l{ActionType} \unicode{0x2192} \l{ActionType::index()}. This index will be used for sorting the \l{Action}{Actions} of a \l{Device} to make sure the \l{Device} looks the same on all clients. Please make sure all \l{ActionType}{ActionTypes} together will create a list from \tt 0 to \tt x.
\li - \underline{\e paramTypes:} A list of \l{ParamType}{ParamTypes} (see section "\l{The ParamType definition}") for this \l{ActionType}. This parameter is optional. You can also create an \l{ActionType} which has no \l{ParamType}{ParamTypes}. \li - \underline{\e paramTypes:} A list of \l{ParamType}{ParamTypes} (see section "\l{The ParamType definition}") for this \l{ActionType}. This parameter is optional. You can also create an \l{ActionType} which has no \l{ParamType}{ParamTypes}.
\endlist \endlist
@ -383,6 +401,7 @@ This mechanism was created to ensure that the \l{EventType} and \l{ActionType} w
"name": "name of the event", "name": "name of the event",
"idName": "eventName", "idName": "eventName",
"id": "uuid", "id": "uuid",
"index": "int",
"paramTypes": [ "paramTypes": [
... ...
] ]
@ -395,6 +414,7 @@ This mechanism was created to ensure that the \l{EventType} and \l{ActionType} w
\li - \underline{\e name:} The visible name of the \l{EventType} \unicode{0x2192} \l{EventType::name()}. \li - \underline{\e name:} The visible name of the \l{EventType} \unicode{0x2192} \l{EventType::name()}.
\li - \underline{\e idName:} This parameter will be used to define the EventTypeId variable named <idName>EventTypeId in the plugininfo.h, so it can be used in the code. \li - \underline{\e idName:} This parameter will be used to define the EventTypeId variable named <idName>EventTypeId in the plugininfo.h, so it can be used in the code.
\li - \underline{\e id:} The actual uuid (\l{EventTypeId}) of the \l{EventType} \unicode{0x2192} \l{EventType::id()}. \li - \underline{\e id:} The actual uuid (\l{EventTypeId}) of the \l{EventType} \unicode{0x2192} \l{EventType::id()}.
\li - \underline{\e index:} The order index of the \l{EventType} \unicode{0x2192} \l{EventType::index()}. This index will be used for sorting the \l{Event}{Events} of a \l{Device} to make sure the \l{Device} looks the same on all clients. Please make sure all \l{EventType}{EventTypes} together will create a list from \tt 0 to \tt x.
\li - \underline{\e paramTypes:} A list of \l{ParamType}{ParamTypes} (see section "\l{The ParamType definition}") for this \l{EventType}. This parameter is optional. You can also create an \l{EventType} which has no \l{ParamType}{ParamTypes}. \li - \underline{\e paramTypes:} A list of \l{ParamType}{ParamTypes} (see section "\l{The ParamType definition}") for this \l{EventType}. This parameter is optional. You can also create an \l{EventType} which has no \l{ParamType}{ParamTypes}.
\endlist \endlist

View File

@ -212,7 +212,12 @@ QList<DeviceClass> DevicePlugin::supportedDevices() const
} }
deviceClass.setCreateMethods(createMethods); deviceClass.setCreateMethods(createMethods);
deviceClass.setDeviceIcon(loadAndVerifyDeviceIcon(jo.value("deviceIcon").toString())); deviceClass.setDeviceIcon(loadAndVerifyDeviceIcon(jo.value("deviceIcon").toString()));
deviceClass.setDiscoveryParamTypes(parseParamTypes(jo.value("discoveryParamTypes").toArray())); QPair<bool, QList<ParamType> > discoveryParamVerification = parseParamTypes(jo.value("discoveryParamTypes").toArray());
if (!discoveryParamVerification.first) {
broken = true;
} else {
deviceClass.setDiscoveryParamTypes(discoveryParamVerification.second);
}
QString setupMethod = jo.value("setupMethod").toString(); QString setupMethod = jo.value("setupMethod").toString();
if (setupMethod == "pushButton") { if (setupMethod == "pushButton") {
@ -227,7 +232,12 @@ QList<DeviceClass> DevicePlugin::supportedDevices() const
deviceClass.setSetupMethod(DeviceClass::SetupMethodJustAdd); deviceClass.setSetupMethod(DeviceClass::SetupMethodJustAdd);
} }
deviceClass.setPairingInfo(jo.value("pairingInfo").toString()); deviceClass.setPairingInfo(jo.value("pairingInfo").toString());
deviceClass.setParamTypes(parseParamTypes(jo.value("paramTypes").toArray())); QPair<bool, QList<ParamType> > paramTypesVerification = parseParamTypes(jo.value("paramTypes").toArray());
if (!paramTypesVerification.first) {
broken = true;
} else {
deviceClass.setParamTypes(paramTypesVerification.second);
}
QList<DeviceClass::BasicTag> basicTags; QList<DeviceClass::BasicTag> basicTags;
foreach (const QJsonValue &basicTagJson, jo.value("basicTags").toArray()) { foreach (const QJsonValue &basicTagJson, jo.value("basicTags").toArray()) {
@ -239,7 +249,7 @@ QList<DeviceClass> DevicePlugin::supportedDevices() const
QList<StateType> stateTypes; QList<StateType> stateTypes;
foreach (const QJsonValue &stateTypesJson, jo.value("stateTypes").toArray()) { foreach (const QJsonValue &stateTypesJson, jo.value("stateTypes").toArray()) {
QJsonObject st = stateTypesJson.toObject(); QJsonObject st = stateTypesJson.toObject();
QStringList missingFields = verifyFields(QStringList() << "type" << "id" << "name", st); QStringList missingFields = verifyFields(QStringList() << "type" << "id" << "name" << "index", st);
if (!missingFields.isEmpty()) { if (!missingFields.isEmpty()) {
qCWarning(dcDeviceManager) << "Skipping device class" << deviceClass.name() << "because of missing" << missingFields.join(", ") << "in stateTypes"; qCWarning(dcDeviceManager) << "Skipping device class" << deviceClass.name() << "because of missing" << missingFields.join(", ") << "in stateTypes";
broken = true; broken = true;
@ -249,6 +259,7 @@ QList<DeviceClass> DevicePlugin::supportedDevices() const
QVariant::Type t = QVariant::nameToType(st.value("type").toString().toLatin1().data()); QVariant::Type t = QVariant::nameToType(st.value("type").toString().toLatin1().data());
StateType stateType(st.value("id").toString()); StateType stateType(st.value("id").toString());
stateType.setName(st.value("name").toString()); stateType.setName(st.value("name").toString());
stateType.setIndex(st.value("index").toInt());
stateType.setType(t); stateType.setType(t);
stateType.setUnit(loadAndVerifyUnit(st.value("unit").toString())); stateType.setUnit(loadAndVerifyUnit(st.value("unit").toString()));
stateType.setDefaultValue(st.value("defaultValue").toVariant()); stateType.setDefaultValue(st.value("defaultValue").toVariant());
@ -279,6 +290,7 @@ QList<DeviceClass> DevicePlugin::supportedDevices() const
// Note: fields already checked in StateType // Note: fields already checked in StateType
ActionType actionType(ActionTypeId(stateType.id().toString())); ActionType actionType(ActionTypeId(stateType.id().toString()));
actionType.setName("set " + stateType.name()); actionType.setName("set " + stateType.name());
actionType.setIndex(stateType.index());
ParamType paramType(stateType.name(), t, stateType.defaultValue()); ParamType paramType(stateType.name(), t, stateType.defaultValue());
paramType.setAllowedValues(stateType.possibleValues()); paramType.setAllowedValues(stateType.possibleValues());
paramType.setUnit(stateType.unit()); paramType.setUnit(stateType.unit());
@ -291,7 +303,7 @@ QList<DeviceClass> DevicePlugin::supportedDevices() const
foreach (const QJsonValue &actionTypesJson, jo.value("actionTypes").toArray()) { foreach (const QJsonValue &actionTypesJson, jo.value("actionTypes").toArray()) {
QJsonObject at = actionTypesJson.toObject(); QJsonObject at = actionTypesJson.toObject();
QStringList missingFields = verifyFields(QStringList() << "id" << "name", at); QStringList missingFields = verifyFields(QStringList() << "id" << "name" << "index", at);
if (!missingFields.isEmpty()) { if (!missingFields.isEmpty()) {
qCWarning(dcDeviceManager) << "Skipping device class" << deviceClass.name() << "because of missing" << missingFields.join(", ") << "in actionTypes"; qCWarning(dcDeviceManager) << "Skipping device class" << deviceClass.name() << "because of missing" << missingFields.join(", ") << "in actionTypes";
broken = true; broken = true;
@ -300,7 +312,14 @@ QList<DeviceClass> DevicePlugin::supportedDevices() const
ActionType actionType(at.value("id").toString()); ActionType actionType(at.value("id").toString());
actionType.setName(at.value("name").toString()); actionType.setName(at.value("name").toString());
actionType.setParamTypes(parseParamTypes(at.value("paramTypes").toArray())); actionType.setIndex(at.value("index").toInt());
QPair<bool, QList<ParamType> > paramVerification = parseParamTypes(at.value("paramTypes").toArray());
if (!paramVerification.first) {
broken = true;
} else {
actionType.setParamTypes(paramVerification.second);
}
actionTypes.append(actionType); actionTypes.append(actionType);
} }
deviceClass.setActionTypes(actionTypes); deviceClass.setActionTypes(actionTypes);
@ -308,7 +327,7 @@ QList<DeviceClass> DevicePlugin::supportedDevices() const
QList<EventType> eventTypes; QList<EventType> eventTypes;
foreach (const QJsonValue &eventTypesJson, jo.value("eventTypes").toArray()) { foreach (const QJsonValue &eventTypesJson, jo.value("eventTypes").toArray()) {
QJsonObject et = eventTypesJson.toObject(); QJsonObject et = eventTypesJson.toObject();
QStringList missingFields = verifyFields(QStringList() << "id" << "name", et); QStringList missingFields = verifyFields(QStringList() << "id" << "name" << "index", et);
if (!missingFields.isEmpty()) { if (!missingFields.isEmpty()) {
qCWarning(dcDeviceManager) << "Skipping device class" << deviceClass.name() << "because of missing" << missingFields.join(", ") << "in eventTypes"; qCWarning(dcDeviceManager) << "Skipping device class" << deviceClass.name() << "because of missing" << missingFields.join(", ") << "in eventTypes";
broken = true; broken = true;
@ -317,11 +336,50 @@ QList<DeviceClass> DevicePlugin::supportedDevices() const
EventType eventType(et.value("id").toString()); EventType eventType(et.value("id").toString());
eventType.setName(et.value("name").toString()); eventType.setName(et.value("name").toString());
eventType.setParamTypes(parseParamTypes(et.value("paramTypes").toArray())); eventType.setIndex(et.value("index").toInt());
QPair<bool, QList<ParamType> > paramVerification = parseParamTypes(et.value("paramTypes").toArray());
if (!paramVerification.first) {
broken = true;
} else {
eventType.setParamTypes(paramVerification.second);
}
eventTypes.append(eventType); eventTypes.append(eventType);
} }
deviceClass.setEventTypes(eventTypes); deviceClass.setEventTypes(eventTypes);
// Note: do this after the actionType / stateType / eventType parsing
if (jo.contains("criticalStateTypeId")) {
StateTypeId criticalStateTypeId = StateTypeId(jo.value("criticalStateTypeId").toString());
if (!deviceClass.hasStateType(criticalStateTypeId)) {
qCWarning(dcDeviceManager) << "Skipping device class" << deviceClass.name() << ": the definend critical stateTypeId" << criticalStateTypeId.toString() << "does not match any StateType of this DeviceClass.";
broken = true;
} else {
deviceClass.setCriticalStateTypeId(criticalStateTypeId);
}
}
if (jo.contains("primaryStateTypeId")) {
StateTypeId primaryStateTypeId = StateTypeId(jo.value("primaryStateTypeId").toString());
if (!deviceClass.hasStateType(primaryStateTypeId)) {
qCWarning(dcDeviceManager) << "Skipping device class" << deviceClass.name() << ": the definend primary stateTypeId" << primaryStateTypeId.toString() << "does not match any StateType of this DeviceClass.";
broken = true;
} else {
deviceClass.setPrimaryStateTypeId(primaryStateTypeId);
}
}
if (jo.contains("primaryActionTypeId")) {
ActionTypeId primaryActionTypeId = ActionTypeId(jo.value("primaryActionTypeId").toString());
if (!deviceClass.hasActionType(primaryActionTypeId)) {
qCWarning(dcDeviceManager) << "Skipping device class" << deviceClass.name() << ": the definend primary actionTypeId" << primaryActionTypeId.toString() << "does not match any ActionType of this DeviceClass.";
broken = true;
} else {
deviceClass.setPrimaryActionTypeId(primaryActionTypeId);
}
}
if (!broken) if (!broken)
deviceClasses.append(deviceClass); deviceClasses.append(deviceClass);
@ -438,25 +496,41 @@ void DevicePlugin::initPlugin(const QJsonObject &metaData, DeviceManager *device
m_metaData = metaData; m_metaData = metaData;
// parse plugin configuration params // parse plugin configuration params
if (m_metaData.contains("paramTypes")) if (m_metaData.contains("paramTypes")) {
m_configurationDescription = parseParamTypes(m_metaData.value("paramTypes").toArray()); QPair<bool, QList<ParamType> > paramVerification = parseParamTypes(m_metaData.value("paramTypes").toArray());
if (paramVerification.first) {
m_configurationDescription = paramVerification.second;
}
}
m_deviceManager = deviceManager; m_deviceManager = deviceManager;
init(); init();
} }
QList<ParamType> DevicePlugin::parseParamTypes(const QJsonArray &array) const QPair<bool, QList<ParamType> > DevicePlugin::parseParamTypes(const QJsonArray &array) const
{ {
QList<ParamType> paramTypes; QList<ParamType> paramTypes;
foreach (const QJsonValue &paramTypesJson, array) { foreach (const QJsonValue &paramTypesJson, array) {
QJsonObject pt = paramTypesJson.toObject(); QJsonObject pt = paramTypesJson.toObject();
// Check fields
QStringList missingFields = verifyFields(QStringList() << "name" << "index" << "type", pt);
if (!missingFields.isEmpty()) {
qCWarning(dcDeviceManager) << pluginName() << "Error parsing ParamType: missing fields" << missingFields.join(", ") << endl << pt;
return QPair<bool, QList<ParamType> >(false, QList<ParamType>());
}
// Check type
QVariant::Type t = QVariant::nameToType(pt.value("type").toString().toLatin1().data()); QVariant::Type t = QVariant::nameToType(pt.value("type").toString().toLatin1().data());
Q_ASSERT_X(t != QVariant::Invalid, if (t == QVariant::Invalid) {
pluginName().toLatin1().data(), qCWarning(dcDeviceManager()) << pluginName() << QString("Invalid type %1 for param %2 in json file.")
QString("Invalid type %1 for param %2 in json file.") .arg(pt.value("type").toString())
.arg(pt.value("type").toString()) .arg(pt.value("name").toString()).toLatin1().data();
.arg(pt.value("name").toString()).toLatin1().data()); return QPair<bool, QList<ParamType> >(false, QList<ParamType>());
}
ParamType paramType(pt.value("name").toString(), t, pt.value("defaultValue").toVariant()); ParamType paramType(pt.value("name").toString(), t, pt.value("defaultValue").toVariant());
paramType.setIndex(pt.value("index").toInt());
// set allowed values // set allowed values
QVariantList allowedValues; QVariantList allowedValues;
@ -482,7 +556,8 @@ QList<ParamType> DevicePlugin::parseParamTypes(const QJsonArray &array) const
paramType.setLimits(pt.value("minValue").toVariant(), pt.value("maxValue").toVariant()); paramType.setLimits(pt.value("minValue").toVariant(), pt.value("maxValue").toVariant());
paramTypes.append(paramType); paramTypes.append(paramType);
} }
return paramTypes;
return QPair<bool, QList<ParamType> >(true, paramTypes);
} }
/*! /*!

View File

@ -41,6 +41,7 @@
#include <QMetaEnum> #include <QMetaEnum>
#include <QJsonObject> #include <QJsonObject>
#include <QMetaObject> #include <QMetaObject>
#include <QPair>
class DeviceManager; class DeviceManager;
class Device; class Device;
@ -126,7 +127,7 @@ protected:
private: private:
void initPlugin(const QJsonObject &metaData, DeviceManager *deviceManager); void initPlugin(const QJsonObject &metaData, DeviceManager *deviceManager);
QList<ParamType> parseParamTypes(const QJsonArray &array) const; QPair<bool, QList<ParamType> > parseParamTypes(const QJsonArray &array) const;
QStringList verifyFields(const QStringList &fields, const QJsonObject &value) const; QStringList verifyFields(const QStringList &fields, const QJsonObject &value) const;

View File

@ -31,44 +31,60 @@
by the plugin. by the plugin.
All Actions must have valid a ActionType in order to be useful. All Actions must have valid a ActionType in order to be useful.
\sa Action \sa Action
*/ */
#include "actiontype.h" #include "actiontype.h"
/*! Constructs an ActionType with the given \a id. */ /*! Constructs an \l{ActionType} with the given \a id. */
ActionType::ActionType(const ActionTypeId &id): ActionType::ActionType(const ActionTypeId &id):
m_id(id) m_id(id),
m_index(0)
{ {
} }
/*! Returns the id of this ActionType. */ /*! Returns the id of this \l{ActionType}. */
ActionTypeId ActionType::id() const ActionTypeId ActionType::id() const
{ {
return m_id; return m_id;
} }
/*! Returns the name of this ActionType. */ /*! Returns the name of this \l{ActionType}. */
QString ActionType::name() const QString ActionType::name() const
{ {
return m_name; return m_name;
} }
/*! Set the \a name for this Action. This will be visible to the user. */ /*! Set the \a name for this \l{ActionType}. This will be visible to the user. */
void ActionType::setName(const QString &name) void ActionType::setName(const QString &name)
{ {
m_name = name; m_name = name;
} }
/*! Returns the parameter description of this ActionType. \l{Action}{Actions} created /*! Returns the index of this \l{ActionType}. The index of an \l{ActionType} indicates the order in the \l{DeviceClass}.
* from this ActionType must have their parameters matching to this template. */ * This guarantees that a \l{Device} will look always the same (\l{Action} order). */
int ActionType::index() const
{
return m_index;
}
/*! Set the \a index of this \l{ActionType}. */
void ActionType::setIndex(const int &index)
{
m_index = index;
}
/*! Returns the parameter description of this \l{ActionType}. \l{Action}{Actions} created
* from this \l{ActionType} must have their parameters matching to this template. */
QList<ParamType> ActionType::paramTypes() const QList<ParamType> ActionType::paramTypes() const
{ {
return m_paramTypes; return m_paramTypes;
} }
/*! Set the parameter description of this ActionType. \l{Action}{Actions} created /*! Set the parameter description of this \l{ActionType}. \l{Action}{Actions} created
* from this ActionType must have their \a paramTypes matching to this template. */ * from this \l{ActionType} must have their \a paramTypes matching to this template. */
void ActionType::setParamTypes(const QList<ParamType> &paramTypes) void ActionType::setParamTypes(const QList<ParamType> &paramTypes)
{ {
m_paramTypes = paramTypes; m_paramTypes = paramTypes;

View File

@ -38,13 +38,16 @@ public:
QString name() const; QString name() const;
void setName(const QString &name); void setName(const QString &name);
int index() const;
void setIndex(const int &index);
QList<ParamType> paramTypes() const; QList<ParamType> paramTypes() const;
void setParamTypes(const QList<ParamType> &paramTypes); void setParamTypes(const QList<ParamType> &paramTypes);
private: private:
ActionTypeId m_id; ActionTypeId m_id;
QString m_name; QString m_name;
int m_index;
QList<ParamType> m_paramTypes; QList<ParamType> m_paramTypes;
}; };

View File

@ -33,8 +33,10 @@
/*! Constructs a EventType object with the given \a id. */ /*! Constructs a EventType object with the given \a id. */
EventType::EventType(const EventTypeId &id): EventType::EventType(const EventTypeId &id):
m_id(id) m_id(id),
m_index(0)
{ {
} }
/*! Returns the id. */ /*! Returns the id. */
@ -55,6 +57,19 @@ void EventType::setName(const QString &name)
m_name = name; m_name = name;
} }
/*! Returns the index of this \l{EventType}. The index of an \l{EventType} indicates the order in the \l{DeviceClass}.
* This guarantees that a \l{Device} will look always the same (\l{Event} order). */
int EventType::index() const
{
return m_index;
}
/*! Set the \a index of this \l{EventType}. */
void EventType::setIndex(const int &index)
{
m_index = index;
}
/*! Holds a List describing possible parameters for a \l{Event} of this EventType. /*! Holds a List describing possible parameters for a \l{Event} of this EventType.
* e.g. QList(ParamType("temperature", QVariant::Real)). */ * e.g. QList(ParamType("temperature", QVariant::Real)). */
QList<ParamType> EventType::paramTypes() const QList<ParamType> EventType::paramTypes() const

View File

@ -38,15 +38,18 @@ public:
QString name() const; QString name() const;
void setName(const QString &name); void setName(const QString &name);
int index() const;
void setIndex(const int &index);
QList<ParamType> paramTypes() const; QList<ParamType> paramTypes() const;
void setParamTypes(const QList<ParamType> &paramTypes); void setParamTypes(const QList<ParamType> &paramTypes);
private: private:
EventTypeId m_id; EventTypeId m_id;
QString m_name; QString m_name;
int m_index;
QList<ParamType> m_paramTypes; QList<ParamType> m_paramTypes;
}; };
#endif // TRIGGERTYPE_H #endif // TRIGGERTYPE_H

View File

@ -35,12 +35,14 @@
/*! Constructs a ParamType object with the given \a name, \a type and \a defaultValue. */ /*! Constructs a ParamType object with the given \a name, \a type and \a defaultValue. */
ParamType::ParamType(const QString &name, const QVariant::Type type, const QVariant &defaultValue): ParamType::ParamType(const QString &name, const QVariant::Type type, const QVariant &defaultValue):
m_name(name), m_name(name),
m_index(0),
m_type(type), m_type(type),
m_defaultValue(defaultValue), m_defaultValue(defaultValue),
m_inputType(Types::InputTypeNone), m_inputType(Types::InputTypeNone),
m_unit(Types::UnitNone), m_unit(Types::UnitNone),
m_readOnly(false) m_readOnly(false)
{ {
} }
/*! Returns the name of this ParamType. */ /*! Returns the name of this ParamType. */
@ -55,6 +57,18 @@ void ParamType::setName(const QString &name)
m_name = name; m_name = name;
} }
/*! Returns the index of this \l{ParamType}. The index of an \l{ParamType} indicates the order in the corresponding Type. */
int ParamType::index() const
{
return m_index;
}
/*! Set the \a index of this \l{ParamType}. */
void ParamType::setIndex(const int &index)
{
m_index = index;
}
/*! Returns the type of this ParamType. */ /*! Returns the type of this ParamType. */
QVariant::Type ParamType::type() const QVariant::Type ParamType::type() const
{ {

View File

@ -36,6 +36,9 @@ public:
QString name() const; QString name() const;
void setName(const QString &name); void setName(const QString &name);
int index() const;
void setIndex(const int &index);
QVariant::Type type() const; QVariant::Type type() const;
void setType(QVariant::Type type); void setType(QVariant::Type type);
@ -65,6 +68,7 @@ public:
private: private:
QString m_name; QString m_name;
int m_index;
QVariant::Type m_type; QVariant::Type m_type;
QVariant m_defaultValue; QVariant m_defaultValue;
QVariant m_minValue; QVariant m_minValue;

View File

@ -36,6 +36,7 @@
* hardcode it into the plugin. */ * hardcode it into the plugin. */
StateType::StateType(const StateTypeId &id): StateType::StateType(const StateTypeId &id):
m_id(id), m_id(id),
m_index(0),
m_defaultValue(QVariant()), m_defaultValue(QVariant()),
m_minValue(QVariant()), m_minValue(QVariant()),
m_maxValue(QVariant()), m_maxValue(QVariant()),
@ -63,6 +64,19 @@ void StateType::setName(const QString &name)
m_name = name; m_name = name;
} }
/*! Returns the index of this \l{StateType}. The index of an \l{StateType} indicates the order in the \l{DeviceClass}.
* This guarantees that a \l{Device} will look always the same (\l{State} order). */
int StateType::index() const
{
return m_index;
}
/*! Set the \a index of this \l{StateType}. */
void StateType::setIndex(const int &index)
{
m_index = index;
}
/*! Returns the Type of the StateType (e.g. QVariant::Real). */ /*! Returns the Type of the StateType (e.g. QVariant::Real). */
QVariant::Type StateType::type() const QVariant::Type StateType::type() const
{ {

View File

@ -37,6 +37,9 @@ public:
QString name() const; QString name() const;
void setName(const QString &name); void setName(const QString &name);
int index() const;
void setIndex(const int &index);
QVariant::Type type() const; QVariant::Type type() const;
void setType(const QVariant::Type &type); void setType(const QVariant::Type &type);
@ -58,6 +61,7 @@ public:
private: private:
StateTypeId m_id; StateTypeId m_id;
QString m_name; QString m_name;
int m_index;
QVariant::Type m_type; QVariant::Type m_type;
QVariant m_defaultValue; QVariant m_defaultValue;
QVariant m_minValue; QVariant m_minValue;

View File

@ -13,6 +13,7 @@
"name": "Avahi Monitor", "name": "Avahi Monitor",
"idName": "avahi", "idName": "avahi",
"deviceIcon": "Network", "deviceIcon": "Network",
"primaryStateTypeId": "b5616fd3-da12-4613-9576-6516b2267180",
"basicTags": [ "basicTags": [
"Device", "Device",
"Sensor" "Sensor"
@ -22,11 +23,13 @@
{ {
"name": "service name", "name": "service name",
"type": "QString", "type": "QString",
"index": 0,
"inputType": "TextLine" "inputType": "TextLine"
}, },
{ {
"name": "host name", "name": "host name",
"type": "QString", "type": "QString",
"index": 1,
"inputType": "TextLine" "inputType": "TextLine"
} }
], ],
@ -36,6 +39,7 @@
"name": "online", "name": "online",
"idName": "online", "idName": "online",
"type": "bool", "type": "bool",
"index": 0,
"defaultValue": false "defaultValue": false
} }
] ]

View File

@ -6,6 +6,7 @@
{ {
"name": "RPL address", "name": "RPL address",
"type": "QString", "type": "QString",
"index": 0,
"inputType": "TextLine", "inputType": "TextLine",
"defaultValue": "fdaa:e9b8:d03a::ff:fe00:1" "defaultValue": "fdaa:e9b8:d03a::ff:fe00:1"
} }
@ -21,6 +22,8 @@
"name": "aWATTar", "name": "aWATTar",
"createMethods": ["user"], "createMethods": ["user"],
"deviceIcon": "Energy", "deviceIcon": "Energy",
"primaryStateTypeId": "eab37309-3dd8-46a0-94d4-bd05b5bb0430",
"criticalStateTypeId": "470b9b88-17f3-42e3-9250-cc181984eafe",
"basicTags": [ "basicTags": [
"Service", "Service",
"Actuator", "Actuator",
@ -31,11 +34,13 @@
{ {
"name": "user uuid", "name": "user uuid",
"type": "QString", "type": "QString",
"index": 0,
"inputType": "TextLine" "inputType": "TextLine"
}, },
{ {
"name": "token", "name": "token",
"type": "QString", "type": "QString",
"index": 1,
"inputType": "Password" "inputType": "Password"
} }
], ],
@ -45,6 +50,7 @@
"idName": "currentMarketPrice", "idName": "currentMarketPrice",
"name": "current market price", "name": "current market price",
"type": "double", "type": "double",
"index": 0,
"unit": "EuroCentPerKiloWattHour", "unit": "EuroCentPerKiloWattHour",
"defaultValue": 0 "defaultValue": 0
}, },
@ -52,6 +58,7 @@
"id": "38b86cee-9588-4269-a585-128907929dc2", "id": "38b86cee-9588-4269-a585-128907929dc2",
"idName": "averageDeviation", "idName": "averageDeviation",
"name": "average deviation", "name": "average deviation",
"index": 1,
"type": "int", "type": "int",
"unit": "Percentage", "unit": "Percentage",
"defaultValue": 0 "defaultValue": 0
@ -60,6 +67,7 @@
"id": "d5a8a176-aca0-45b1-b043-95c43750f383", "id": "d5a8a176-aca0-45b1-b043-95c43750f383",
"idName": "validUntil", "idName": "validUntil",
"name": "valid until", "name": "valid until",
"index": 2,
"unit": "UnixTime", "unit": "UnixTime",
"type": "int", "type": "int",
"defaultValue": 0 "defaultValue": 0
@ -68,6 +76,7 @@
"id": "55d6d7a8-446f-48ae-8014-1225810d03ee", "id": "55d6d7a8-446f-48ae-8014-1225810d03ee",
"idName": "averagePrice", "idName": "averagePrice",
"name": "average market price [± 12 h]", "name": "average market price [± 12 h]",
"index": 3,
"type": "double", "type": "double",
"unit": "EuroCentPerKiloWattHour", "unit": "EuroCentPerKiloWattHour",
"defaultValue": 0 "defaultValue": 0
@ -76,6 +85,7 @@
"id": "e7af5bdc-48d7-4e96-b877-331da4dcfae5", "id": "e7af5bdc-48d7-4e96-b877-331da4dcfae5",
"idName": "lowestPrice", "idName": "lowestPrice",
"name": "lowest market price [± 12 h]", "name": "lowest market price [± 12 h]",
"index": 4,
"type": "double", "type": "double",
"unit": "EuroCentPerKiloWattHour", "unit": "EuroCentPerKiloWattHour",
"defaultValue": 0 "defaultValue": 0
@ -84,6 +94,7 @@
"id": "0c171c42-b070-453e-8a63-df9aebfa8533", "id": "0c171c42-b070-453e-8a63-df9aebfa8533",
"idName": "highestPrice", "idName": "highestPrice",
"name": "highest market price [± 12 h]", "name": "highest market price [± 12 h]",
"index": 5,
"type": "double", "type": "double",
"unit": "EuroCentPerKiloWattHour", "unit": "EuroCentPerKiloWattHour",
"defaultValue": 0 "defaultValue": 0
@ -91,6 +102,7 @@
{ {
"id": "470b9b88-17f3-42e3-9250-cc181984eafe", "id": "470b9b88-17f3-42e3-9250-cc181984eafe",
"idName": "online", "idName": "online",
"index": 6,
"name": "online", "name": "online",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
@ -98,6 +110,7 @@
{ {
"id": "1c9d139a-6618-4a39-bc83-37f80942017d", "id": "1c9d139a-6618-4a39-bc83-37f80942017d",
"idName": "reachable", "idName": "reachable",
"index": 7,
"name": "pump reachable", "name": "pump reachable",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
@ -106,6 +119,7 @@
"id": "b83d3533-aeae-4a9b-95d8-28466bf6c0cf", "id": "b83d3533-aeae-4a9b-95d8-28466bf6c0cf",
"idName": "sgMode", "idName": "sgMode",
"name": "sg-mode", "name": "sg-mode",
"index": 8,
"type": "QString", "type": "QString",
"possibleValues": [ "possibleValues": [
"0 - Invalid", "0 - Invalid",
@ -120,6 +134,7 @@
"id": "4c303bcd-152d-45ad-874d-d57fc87a26bb", "id": "4c303bcd-152d-45ad-874d-d57fc87a26bb",
"idName": "sgSyncMode", "idName": "sgSyncMode",
"name": "sync mode", "name": "sync mode",
"index": 9,
"type": "QString", "type": "QString",
"possibleValues": [ "possibleValues": [
"auto", "auto",
@ -134,10 +149,12 @@
"id": "dd82f6c7-5e92-48ca-b0bc-bdc55d3e1482", "id": "dd82f6c7-5e92-48ca-b0bc-bdc55d3e1482",
"idName": "setSgMode", "idName": "setSgMode",
"name": "set sg-mode", "name": "set sg-mode",
"index": 0,
"paramTypes": [ "paramTypes": [
{ {
"name": "sg-mode", "name": "sg-mode",
"type": "QString", "type": "QString",
"index": 0,
"allowedValues": [ "allowedValues": [
"1 - Off", "1 - Off",
"2 - Normal", "2 - Normal",

View File

@ -12,6 +12,7 @@
"idName": "application", "idName": "application",
"name": "Application launcher", "name": "Application launcher",
"createMethods": ["user"], "createMethods": ["user"],
"primaryActionTypeId": "cf52b41d-3108-423c-8907-ca5b4d97cac5",
"basicTags": [ "basicTags": [
"Service", "Service",
"Actuator" "Actuator"
@ -20,6 +21,7 @@
{ {
"name": "command", "name": "command",
"type": "QString", "type": "QString",
"index": 0,
"inputType": "TextLine" "inputType": "TextLine"
} }
], ],
@ -28,6 +30,7 @@
"id": "28d7e933-ff05-4f4c-95a0-482689543de5", "id": "28d7e933-ff05-4f4c-95a0-482689543de5",
"idName": "running", "idName": "running",
"name": "running", "name": "running",
"index": 0,
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
} }
@ -36,12 +39,14 @@
{ {
"id": "cf52b41d-3108-423c-8907-ca5b4d97cac5", "id": "cf52b41d-3108-423c-8907-ca5b4d97cac5",
"idName": "execute", "idName": "execute",
"name": "execute" "name": "execute",
"index": 0
}, },
{ {
"id": "d21b1fed-1dd9-4c5a-a64e-0c6ba94059be", "id": "d21b1fed-1dd9-4c5a-a64e-0c6ba94059be",
"idName": "kill", "idName": "kill",
"name": "kill" "name": "kill",
"index": 1
} }
] ]
}, },
@ -54,10 +59,12 @@
"Actuator" "Actuator"
], ],
"createMethods": ["user"], "createMethods": ["user"],
"primaryActionTypeId": "cf52b41d-3108-423c-8907-ca5b4d97cac5",
"paramTypes": [ "paramTypes": [
{ {
"name": "script", "name": "script",
"type": "QString", "type": "QString",
"index": 0,
"inputType": "Url" "inputType": "Url"
} }
], ],
@ -66,6 +73,7 @@
"id": "28d7e933-ff05-4f4c-95a0-482689543de5", "id": "28d7e933-ff05-4f4c-95a0-482689543de5",
"idName": "running", "idName": "running",
"name": "running", "name": "running",
"index": 0,
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
} }
@ -74,12 +82,14 @@
{ {
"id": "cf52b41d-3108-423c-8907-ca5b4d97cac5", "id": "cf52b41d-3108-423c-8907-ca5b4d97cac5",
"idName": "execute", "idName": "execute",
"name": "execute" "name": "execute",
"index": 0
}, },
{ {
"id": "d21b1fed-1dd9-4c5a-a64e-0c6ba94059be", "id": "d21b1fed-1dd9-4c5a-a64e-0c6ba94059be",
"idName": "kill", "idName": "kill",
"name": "kill" "name": "kill",
"index": 1
} }
] ]
} }

View File

@ -24,17 +24,20 @@
{ {
"id": "e015419c-9df9-4bf5-a439-f1f32aedd1db", "id": "e015419c-9df9-4bf5-a439-f1f32aedd1db",
"idName": "up", "idName": "up",
"name": "up" "name": "up",
"index": 0
}, },
{ {
"id": "c58a463a-f765-4a61-b2e2-883cc23878c0", "id": "c58a463a-f765-4a61-b2e2-883cc23878c0",
"idName": "down", "idName": "down",
"name": "down" "name": "down",
"index": 1
}, },
{ {
"id": "4125a18e-fa2d-4b25-acd1-e148d5d665f5", "id": "4125a18e-fa2d-4b25-acd1-e148d5d665f5",
"idName": "sync", "idName": "sync",
"name": "Send sync signal" "name": "Send sync signal",
"index": 2
} }
] ]
} }

View File

@ -24,6 +24,7 @@
"id": "ab16997c-be29-438e-b588-2507d723d264", "id": "ab16997c-be29-438e-b588-2507d723d264",
"idName": "timeZone", "idName": "timeZone",
"name": "timezone", "name": "timezone",
"index": 0,
"type": "QString", "type": "QString",
"defaultValue": "-" "defaultValue": "-"
}, },
@ -31,6 +32,7 @@
"id": "65d2a5ff-bcab-43a8-b043-f88cf01586f4", "id": "65d2a5ff-bcab-43a8-b043-f88cf01586f4",
"idName": "city", "idName": "city",
"name": "city", "name": "city",
"index": 1,
"type": "QString", "type": "QString",
"defaultValue": "-" "defaultValue": "-"
}, },
@ -38,13 +40,15 @@
"id": "a534bd8b-6826-4d71-b9f9-df1433964b94", "id": "a534bd8b-6826-4d71-b9f9-df1433964b94",
"idName": "country", "idName": "country",
"name": "country", "name": "country",
"index": 2,
"type": "QString", "type": "QString",
"defaultValue": "-" "defaultValue": "-"
}, },
{ {
"id": "eb5231ea-6a1b-4d7e-a95f-d49e7b25122e", "id": "eb5231ea-6a1b-4d7e-a95f-d49e7b25122e",
"name": "day",
"idName": "day", "idName": "day",
"name": "day",
"index": 3,
"type": "int", "type": "int",
"defaultValue": 1, "defaultValue": 1,
"minValue": 1, "minValue": 1,
@ -52,8 +56,9 @@
}, },
{ {
"id": "fcd8ec96-4488-438a-8b30-58bfe2a7fae2", "id": "fcd8ec96-4488-438a-8b30-58bfe2a7fae2",
"name": "month",
"idName": "month", "idName": "month",
"name": "month",
"index": 4,
"type": "int", "type": "int",
"defaultValue": 1, "defaultValue": 1,
"minValue": 1, "minValue": 1,
@ -63,6 +68,7 @@
"id": "a37acc9c-5cfb-4687-adce-e56beb32586f", "id": "a37acc9c-5cfb-4687-adce-e56beb32586f",
"idName": "monthName", "idName": "monthName",
"name": "month name", "name": "month name",
"index": 5,
"type": "QString", "type": "QString",
"defaultValue": "-" "defaultValue": "-"
}, },
@ -70,6 +76,7 @@
"id": "79d4ae9b-ea27-4346-8229-1d90f1ddfc9d", "id": "79d4ae9b-ea27-4346-8229-1d90f1ddfc9d",
"idName": "year", "idName": "year",
"name": "year", "name": "year",
"index": 6,
"type": "int", "type": "int",
"defaultValue": "1970" "defaultValue": "1970"
}, },
@ -78,6 +85,7 @@
"idName": "weekday", "idName": "weekday",
"name": "weekday", "name": "weekday",
"type": "int", "type": "int",
"index": 7,
"defaultValue": 1, "defaultValue": 1,
"minValue": 1, "minValue": 1,
"maxValue": 7 "maxValue": 7
@ -86,6 +94,7 @@
"id": "f627d052-cee6-4727-b9c6-0e935d41e04a", "id": "f627d052-cee6-4727-b9c6-0e935d41e04a",
"idName": "weekdayName", "idName": "weekdayName",
"name": "weekday name", "name": "weekday name",
"index": 8,
"type": "QString", "type": "QString",
"defaultValue": "-" "defaultValue": "-"
}, },
@ -93,6 +102,7 @@
"id": "4de5b57b-bb1a-4d66-9ce3-22bb280b075d", "id": "4de5b57b-bb1a-4d66-9ce3-22bb280b075d",
"idName": "weekend", "idName": "weekend",
"name": "weekend", "name": "weekend",
"index": 9,
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
}, },
@ -100,6 +110,7 @@
"id": "44a99419-fbcd-4d8e-9441-897848b8f77c", "id": "44a99419-fbcd-4d8e-9441-897848b8f77c",
"idName": "dusk", "idName": "dusk",
"name": "dusk", "name": "dusk",
"index": 10,
"unit": "UnixTime", "unit": "UnixTime",
"type": "int", "type": "int",
"defaultValue": 0 "defaultValue": 0
@ -108,6 +119,7 @@
"id": "3a08824d-285b-412e-a515-9664b491a85c", "id": "3a08824d-285b-412e-a515-9664b491a85c",
"idName": "sunrise", "idName": "sunrise",
"name": "sunrise", "name": "sunrise",
"index": 11,
"unit": "UnixTime", "unit": "UnixTime",
"type": "int", "type": "int",
"defaultValue": 0 "defaultValue": 0
@ -116,6 +128,7 @@
"id": "d92be29a-929c-4240-91a0-30153850f838", "id": "d92be29a-929c-4240-91a0-30153850f838",
"idName": "noon", "idName": "noon",
"name": "sun noon", "name": "sun noon",
"index": 12,
"unit": "UnixTime", "unit": "UnixTime",
"type": "int", "type": "int",
"defaultValue": 0 "defaultValue": 0
@ -124,6 +137,7 @@
"id": "a5779b11-0499-4a6d-a7bd-8143dcc546b4", "id": "a5779b11-0499-4a6d-a7bd-8143dcc546b4",
"idName": "dawn", "idName": "dawn",
"name": "dawn", "name": "dawn",
"index": 13,
"unit": "UnixTime", "unit": "UnixTime",
"type": "int", "type": "int",
"defaultValue": 0 "defaultValue": 0
@ -132,6 +146,7 @@
"id": "377f04a7-df58-42ad-a234-e9e23bdc2f85", "id": "377f04a7-df58-42ad-a234-e9e23bdc2f85",
"idName": "sunset", "idName": "sunset",
"name": "sunset", "name": "sunset",
"index": 14,
"unit": "UnixTime", "unit": "UnixTime",
"type": "int", "type": "int",
"defaultValue": 0 "defaultValue": 0
@ -141,27 +156,32 @@
{ {
"id": "792885f3-f505-42db-8c74-3d0460b575a1", "id": "792885f3-f505-42db-8c74-3d0460b575a1",
"idName": "dusk", "idName": "dusk",
"name": "dusk" "name": "dusk",
"index": 0
}, },
{ {
"id": "726acb30-928b-43da-a790-977a821c979e", "id": "726acb30-928b-43da-a790-977a821c979e",
"idName": "sunrise", "idName": "sunrise",
"name": "sunrise" "name": "sunrise",
"index": 1
}, },
{ {
"id": "97ae8dd8-640c-4f9b-8773-aa7abb1d32fa", "id": "97ae8dd8-640c-4f9b-8773-aa7abb1d32fa",
"idName": "noon", "idName": "noon",
"name": "noon" "name": "noon",
"index": 2
}, },
{ {
"id": "5e3657b0-a459-4837-a632-0b20de4b7349", "id": "5e3657b0-a459-4837-a632-0b20de4b7349",
"idName": "dawn", "idName": "dawn",
"name": "dawn" "name": "dawn",
"index": 3
}, },
{ {
"id": "f40d6e0f-fda2-475e-a6ae-c3fee03138b9", "id": "f40d6e0f-fda2-475e-a6ae-c3fee03138b9",
"idName": "sunset", "idName": "sunset",
"name": "sunset" "name": "sunset",
"index": 4
} }
] ]
}, },
@ -180,48 +200,58 @@
{ {
"name": "monday", "name": "monday",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false,
"index": 0
}, },
{ {
"name": "tuesday", "name": "tuesday",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false,
"index": 1
}, },
{ {
"name": "wednesday", "name": "wednesday",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false,
"index": 2
}, },
{ {
"name": "thursday", "name": "thursday",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false,
"index": 3
}, },
{ {
"name": "friday", "name": "friday",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false,
"index": 4
}, },
{ {
"name": "saturday", "name": "saturday",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false,
"index": 5
}, },
{ {
"name": "sunday", "name": "sunday",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false,
"index": 6
}, },
{ {
"name": "minutes", "name": "minutes",
"index": 7,
"type": "int", "type": "int",
"unit": "Minutes", "unit": "Minutes",
"minValue": 0, "minValue": 0,
"maxValue": 60, "maxValue": 60,
"defaultValue": 0 "defaultValue": 0
}, },
{ {
"name": "hours", "name": "hours",
"index": 8,
"type": "int", "type": "int",
"minValue": 0, "minValue": 0,
"maxValue": 24, "maxValue": 24,
@ -231,6 +261,7 @@
{ {
"name": "time type", "name": "time type",
"type": "QString", "type": "QString",
"index": 9,
"allowedValues": [ "allowedValues": [
"time", "time",
"dusk", "dusk",
@ -243,6 +274,7 @@
}, },
{ {
"name": "offset", "name": "offset",
"index": 10,
"type": "int", "type": "int",
"minValue": -120, "minValue": -120,
"maxValue": 120, "maxValue": 120,
@ -254,6 +286,7 @@
{ {
"id": "5ec9a4af-d5ea-4f68-ab32-f7a3fcd75ccc", "id": "5ec9a4af-d5ea-4f68-ab32-f7a3fcd75ccc",
"idName": "alarm", "idName": "alarm",
"index": 0,
"name": "alarm" "name": "alarm"
} }
] ]
@ -272,6 +305,7 @@
"paramTypes": [ "paramTypes": [
{ {
"name": "seconds", "name": "seconds",
"index": 0,
"type": "int", "type": "int",
"unit": "Seconds", "unit": "Seconds",
"minValue": 0, "minValue": 0,
@ -280,6 +314,7 @@
}, },
{ {
"name": "minutes", "name": "minutes",
"index": 1,
"type": "int", "type": "int",
"unit": "Minutes", "unit": "Minutes",
"minValue": 0, "minValue": 0,
@ -288,6 +323,7 @@
}, },
{ {
"name": "hours", "name": "hours",
"index": 2,
"type": "int", "type": "int",
"unit": "Hours", "unit": "Hours",
"minValue": 0, "minValue": 0,
@ -296,6 +332,7 @@
}, },
{ {
"name": "repeating", "name": "repeating",
"index": 3,
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
} }
@ -304,7 +341,8 @@
{ {
"id": "1db11351-ad67-448e-a784-216741a06a58", "id": "1db11351-ad67-448e-a784-216741a06a58",
"idName": "timeout", "idName": "timeout",
"name": "timeout" "name": "timeout",
"index": 0
} }
], ],
"stateTypes": [ "stateTypes": [
@ -312,6 +350,7 @@
"id": "b21ccd53-1ebd-41a0-a2a3-662874e79837", "id": "b21ccd53-1ebd-41a0-a2a3-662874e79837",
"idName": "running", "idName": "running",
"name": "running", "name": "running",
"index": 0,
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
} }
@ -320,17 +359,20 @@
{ {
"id": "436e9923-6eff-444e-bde7-a61228a4d748", "id": "436e9923-6eff-444e-bde7-a61228a4d748",
"idName": "start", "idName": "start",
"name": "start" "name": "start",
"index": 0
}, },
{ {
"id": "bf4d1def-4159-4254-a76d-fd31aaa84e2d", "id": "bf4d1def-4159-4254-a76d-fd31aaa84e2d",
"idName": "stop", "idName": "stop",
"name": "stop" "name": "stop",
"index": 1
}, },
{ {
"id": "14aad613-b972-411f-93c9-f00bfd254285", "id": "14aad613-b972-411f-93c9-f00bfd254285",
"idName": "restart", "idName": "restart",
"name": "restart" "name": "restart",
"index": 2
} }
] ]
} }

View File

@ -13,6 +13,7 @@
"idName": "AVRX1000", "idName": "AVRX1000",
"name": "AVR X1000", "name": "AVR X1000",
"createMethods": ["user"], "createMethods": ["user"],
"criticalStateTypeId": "4d1790bf-28c6-4c1f-8892-ba1a0ef140f5",
"deviceIcon": "Hifi", "deviceIcon": "Hifi",
"basicTags": [ "basicTags": [
"Device", "Device",
@ -22,6 +23,7 @@
{ {
"name": "ip", "name": "ip",
"type" : "QString", "type" : "QString",
"index": 0,
"inputType": "IPv4Address" "inputType": "IPv4Address"
} }
], ],
@ -30,6 +32,7 @@
"id": "4d1790bf-28c6-4c1f-8892-ba1a0ef140f5", "id": "4d1790bf-28c6-4c1f-8892-ba1a0ef140f5",
"idName": "connected", "idName": "connected",
"name": "connected", "name": "connected",
"index": 0,
"type": "bool" "type": "bool"
}, },
{ {
@ -37,6 +40,7 @@
"id": "1cdb6b54-6831-4900-95b2-c78f64497701", "id": "1cdb6b54-6831-4900-95b2-c78f64497701",
"idName": "power", "idName": "power",
"type": "bool", "type": "bool",
"index": 1,
"defaultValue": false, "defaultValue": false,
"writable": true "writable": true
}, },
@ -44,6 +48,7 @@
"name": "volume", "name": "volume",
"id": "773636b9-304d-463a-8755-fc7488dc0ff3", "id": "773636b9-304d-463a-8755-fc7488dc0ff3",
"idName": "volume", "idName": "volume",
"index": 2,
"type": "int", "type": "int",
"unit": "Dezibel", "unit": "Dezibel",
"defaultValue": 0, "defaultValue": 0,
@ -55,6 +60,7 @@
"name": "channel", "name": "channel",
"id": "f29ffa2c-31d6-4d88-b160-a38288c82ce1", "id": "f29ffa2c-31d6-4d88-b160-a38288c82ce1",
"idName": "channel", "idName": "channel",
"index": 3,
"type": "QString", "type": "QString",
"writable": true, "writable": true,
"possibleValues": [ "possibleValues": [

View File

@ -21,11 +21,13 @@
{ {
"name": "name", "name": "name",
"type": "QString", "type": "QString",
"index": 0,
"defaultValue": "Dollhouse Connection" "defaultValue": "Dollhouse Connection"
}, },
{ {
"name": "RPL address", "name": "RPL address",
"type": "QString", "type": "QString",
"index": 1,
"inputType": "TextLine", "inputType": "TextLine",
"defaultValue": "fdaa:e9b8:d03a::ff:fe00:1" "defaultValue": "fdaa:e9b8:d03a::ff:fe00:1"
} }
@ -36,6 +38,7 @@
"idName": "light", "idName": "light",
"deviceClassId": "b4dd5f10-36d4-4232-867a-6d3b04a08bad", "deviceClassId": "b4dd5f10-36d4-4232-867a-6d3b04a08bad",
"createMethods": ["auto"], "createMethods": ["auto"],
"criticalStateTypeId": "93c539b4-50d8-431e-8be4-5ebba89452b7",
"basicTags": [ "basicTags": [
"Device", "Device",
"Lighting" "Lighting"
@ -44,21 +47,25 @@
{ {
"name": "name", "name": "name",
"type": "QString", "type": "QString",
"index": 0,
"defaultValue": "Dollhouse Light" "defaultValue": "Dollhouse Light"
}, },
{ {
"name": "address", "name": "address",
"type": "QString" "type": "QString",
"index": 1
}, },
{ {
"name": "light id", "name": "light id",
"type": "int", "type": "int",
"index": 2,
"defaultValue": 0, "defaultValue": 0,
"readOnly": true "readOnly": true
}, },
{ {
"name": "connection uuid", "name": "connection uuid",
"type": "QString", "type": "QString",
"index": 3,
"inputType": "TextLine", "inputType": "TextLine",
"readOnly": true "readOnly": true
} }
@ -68,6 +75,7 @@
"id": "e4885a73-9fe1-48ca-b773-aeb93f34cd54", "id": "e4885a73-9fe1-48ca-b773-aeb93f34cd54",
"idName": "color", "idName": "color",
"name": "color", "name": "color",
"index": 0,
"type": "QColor", "type": "QColor",
"defaultValue": "#fff30a", "defaultValue": "#fff30a",
"writable": true "writable": true
@ -76,6 +84,7 @@
"id": "e78c9136-c10a-45c9-b6bc-2d937f09cdec", "id": "e78c9136-c10a-45c9-b6bc-2d937f09cdec",
"idName": "brightness", "idName": "brightness",
"name": "brightness", "name": "brightness",
"index": 1,
"type": "int", "type": "int",
"unit": "Percentage", "unit": "Percentage",
"minValue": 0, "minValue": 0,
@ -87,6 +96,7 @@
"id": "f6ac30a0-77b8-4f1f-8c44-4c2e6d542663", "id": "f6ac30a0-77b8-4f1f-8c44-4c2e6d542663",
"idName": "power", "idName": "power",
"name": "power", "name": "power",
"index": 2,
"type": "bool", "type": "bool",
"defaultValue": false, "defaultValue": false,
"writable": true "writable": true
@ -95,6 +105,7 @@
"id": "93c539b4-50d8-431e-8be4-5ebba89452b7", "id": "93c539b4-50d8-431e-8be4-5ebba89452b7",
"idName": "reachable", "idName": "reachable",
"name": "reachable", "name": "reachable",
"index": 3,
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
} }

View File

@ -12,6 +12,7 @@
"idName": "avea", "idName": "avea",
"name": "Avea", "name": "Avea",
"deviceIcon": "LightBulb", "deviceIcon": "LightBulb",
"criticalStateTypeId": "6d5e792a-c786-40d2-ae35-a48ac6fafcbc",
"basicTags": [ "basicTags": [
"Device", "Device",
"Actuator", "Actuator",
@ -22,11 +23,13 @@
{ {
"name": "name", "name": "name",
"type": "QString", "type": "QString",
"index": 0,
"inputType": "TextLine" "inputType": "TextLine"
}, },
{ {
"name": "mac address", "name": "mac address",
"type": "QString", "type": "QString",
"index": 1,
"inputType": "MacAddress" "inputType": "MacAddress"
} }
], ],
@ -35,6 +38,7 @@
"id": "6d5e792a-c786-40d2-ae35-a48ac6fafcbc", "id": "6d5e792a-c786-40d2-ae35-a48ac6fafcbc",
"idName": "available", "idName": "available",
"name": "available", "name": "available",
"index": 0,
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
}, },
@ -42,6 +46,7 @@
"id": "c38181a0-e19b-423f-8b66-dedda94e89b5", "id": "c38181a0-e19b-423f-8b66-dedda94e89b5",
"idName": "brightness", "idName": "brightness",
"name": "brightness", "name": "brightness",
"index": 1,
"type": "int", "type": "int",
"minimumValue": 0, "minimumValue": 0,
"maximumValue": 100, "maximumValue": 100,
@ -52,6 +57,7 @@
"id": "2073b44b-2f99-4abf-8d9f-6b33be8e1763", "id": "2073b44b-2f99-4abf-8d9f-6b33be8e1763",
"idName": "liveliness", "idName": "liveliness",
"name": "liveliness", "name": "liveliness",
"index": 2,
"type": "int", "type": "int",
"minimumValue": 0, "minimumValue": 0,
"maximumValue": 100, "maximumValue": 100,
@ -63,26 +69,31 @@
{ {
"id": "30b6334d-37cd-4b94-a397-3b9b642c762e", "id": "30b6334d-37cd-4b94-a397-3b9b642c762e",
"idName": "connect", "idName": "connect",
"index": 0,
"name": "connect" "name": "connect"
}, },
{ {
"id": "1daa8def-85d7-44fb-b0bd-77a4301056e5", "id": "1daa8def-85d7-44fb-b0bd-77a4301056e5",
"idName": "disconnect", "idName": "disconnect",
"index": 1,
"name": "disconnect" "name": "disconnect"
}, },
{ {
"id": "b2f39b7b-dd11-4db4-a82b-dd3d4b973bd5", "id": "b2f39b7b-dd11-4db4-a82b-dd3d4b973bd5",
"idName": "powerOff", "idName": "powerOff",
"index": 2,
"name": "power off" "name": "power off"
}, },
{ {
"id": "7936bd51-7ea3-4df4-9998-7325de85b677", "id": "7936bd51-7ea3-4df4-9998-7325de85b677",
"idName": "color", "idName": "color",
"index": 3,
"name": "set color", "name": "set color",
"paramTypes": [ "paramTypes": [
{ {
"name": "color", "name": "color",
"type": "QString", "type": "QString",
"index": 0,
"allowedValues": [ "allowedValues": [
"green", "green",
"yellow", "yellow",
@ -98,11 +109,13 @@
{ {
"id": "dfbc86e8-3891-4782-ae14-05228e70423e", "id": "dfbc86e8-3891-4782-ae14-05228e70423e",
"idName": "mood", "idName": "mood",
"index": 4,
"name": "set mood", "name": "set mood",
"paramTypes": [ "paramTypes": [
{ {
"name": "mood", "name": "mood",
"type": "QString", "type": "QString",
"index": 0,
"allowedValues": [ "allowedValues": [
"calm provence", "calm provence",
"cozy flames", "cozy flames",

View File

@ -18,46 +18,57 @@
], ],
"idName": "elroSocket", "idName": "elroSocket",
"createMethods": ["user"], "createMethods": ["user"],
"primaryActionTypeId": "31c9758e-6567-4f89-85bb-29e1a7c55d44",
"paramTypes": [ "paramTypes": [
{ {
"name": "channel 1", "name": "channel 1",
"type": "bool" "type": "bool",
"index": 0
}, },
{ {
"name": "channel 2", "name": "channel 2",
"type": "bool" "type": "bool",
"index": 1
}, },
{ {
"name": "channel 3", "name": "channel 3",
"type": "bool" "type": "bool",
"index": 3
}, },
{ {
"name": "channel 4", "name": "channel 4",
"type": "bool" "type": "bool",
"index": 4
}, },
{ {
"name": "channel 5", "name": "channel 5",
"type": "bool" "type": "bool",
"index": 5
}, },
{ {
"name": "A", "name": "A",
"type": "bool" "type": "bool",
"index": 6
}, },
{ {
"name": "B", "name": "B",
"type": "bool" "type": "bool",
"index": 7
}, },
{ {
"name": "C", "name": "C",
"type": "bool" "type": "bool",
"index": 8
}, },
{ {
"name": "D", "name": "D",
"type": "bool" "type": "bool",
"index": 9
}, },
{ {
"name": "E", "name": "E",
"type": "bool" "type": "bool",
"index": 10
} }
], ],
"actionTypes": [ "actionTypes": [
@ -65,10 +76,12 @@
"id": "31c9758e-6567-4f89-85bb-29e1a7c55d44", "id": "31c9758e-6567-4f89-85bb-29e1a7c55d44",
"idName": "power", "idName": "power",
"name": "set power", "name": "set power",
"index": 0,
"paramTypes": [ "paramTypes": [
{ {
"name": "power", "name": "power",
"type": "bool" "type": "bool",
"index": 0
} }
] ]
} }

View File

@ -13,6 +13,7 @@
"idName": "cube", "idName": "cube",
"name": "Max! Cube LAN Gateway", "name": "Max! Cube LAN Gateway",
"deviceIcon": "Gateway", "deviceIcon": "Gateway",
"criticalStateTypeId": "d0a9a369-cf8c-47c4-a12e-f2d076bf12fd",
"basicTags": [ "basicTags": [
"Device", "Device",
"Gateway", "Gateway",
@ -24,20 +25,24 @@
{ {
"name": "host address", "name": "host address",
"type": "QString", "type": "QString",
"inputType": "IPv4Address" "inputType": "IPv4Address",
"index": 0
}, },
{ {
"name": "port", "name": "port",
"type": "int" "type": "int",
"index": 1
}, },
{ {
"name": "serial number", "name": "serial number",
"type": "QString", "type": "QString",
"inputType": "TextLine" "inputType": "TextLine",
"index": 2
}, },
{ {
"name": "firmware version", "name": "firmware version",
"type": "int" "type": "int",
"index": 3
} }
], ],
"stateTypes": [ "stateTypes": [
@ -45,6 +50,7 @@
"id": "d0a9a369-cf8c-47c4-a12e-f2d076bf12fd", "id": "d0a9a369-cf8c-47c4-a12e-f2d076bf12fd",
"idName": "connection", "idName": "connection",
"name": "connected", "name": "connected",
"index": 0,
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
}, },
@ -52,6 +58,7 @@
"id": "2c2367da-c229-40ed-9d47-a6e73cd6dc3b", "id": "2c2367da-c229-40ed-9d47-a6e73cd6dc3b",
"idName": "portalEnabled", "idName": "portalEnabled",
"name": "portal enabled", "name": "portal enabled",
"index": 1,
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
} }
@ -62,6 +69,7 @@
"idName": "wallThermostate", "idName": "wallThermostate",
"name": "Max! Wall Thermostat", "name": "Max! Wall Thermostat",
"deviceIcon": "Thermometer", "deviceIcon": "Thermometer",
"primaryStateTypeId": "852e7708-db1d-42d1-96e4-19c13598262c",
"basicTags": [ "basicTags": [
"Device", "Device",
"Heating", "Heating",
@ -72,54 +80,65 @@
"paramTypes": [ "paramTypes": [
{ {
"name": "serial number", "name": "serial number",
"type": "QString" "type": "QString",
"index": 0
}, },
{ {
"name": "name", "name": "name",
"type": "QString" "type": "QString",
"index": 1
}, },
{ {
"name": "parent cube", "name": "parent cube",
"type": "QString" "type": "QString",
"index": 2
}, },
{ {
"name": "rf address", "name": "rf address",
"type": "QString" "type": "QString",
"index": 3
}, },
{ {
"name": "room id", "name": "room id",
"type": "int" "type": "int",
"index": 4
}, },
{ {
"name": "room name", "name": "room name",
"type": "QString" "type": "QString",
"index": 5
} }
], ],
"actionTypes": [ "actionTypes": [
{ {
"id": "162b4b3d-9923-4f2c-a755-b50c8a06a6f0", "id": "162b4b3d-9923-4f2c-a755-b50c8a06a6f0",
"idName": "setAutoMode", "idName": "setAutoMode",
"name": "set auto mode" "name": "set auto mode",
"index": 0
}, },
{ {
"id": "8e604437-9f5b-4c17-b5b0-e2db6007af5b", "id": "8e604437-9f5b-4c17-b5b0-e2db6007af5b",
"idName": "setManualMode", "idName": "setManualMode",
"name": "set manual mode" "name": "set manual mode",
"index": 1
}, },
{ {
"id": "27a981e8-ec23-4ba8-921e-33b911a7dd89", "id": "27a981e8-ec23-4ba8-921e-33b911a7dd89",
"idName": "setEcoMode", "idName": "setEcoMode",
"name": "set eco mode" "name": "set eco mode",
"index": 2
}, },
{ {
"id": "184fb112-7a03-4560-8634-0257c969c26e", "id": "184fb112-7a03-4560-8634-0257c969c26e",
"idName": "displayCurrentTemp", "idName": "displayCurrentTemp",
"name": "display current temperature", "name": "display current temperature",
"index": 3,
"paramTypes": [ "paramTypes": [
{ {
"name": "display", "name": "display",
"type": "bool", "type": "bool",
"defaultValue": true "defaultValue": true,
"index": 0
} }
] ]
} }
@ -130,6 +149,7 @@
"idName": "comfortTemp", "idName": "comfortTemp",
"name": "comfort temperature", "name": "comfort temperature",
"type": "double", "type": "double",
"index": 0,
"unit": "DegreeCelsius", "unit": "DegreeCelsius",
"defaultValue": 0 "defaultValue": 0
}, },
@ -138,6 +158,7 @@
"idName": "ecoTemp", "idName": "ecoTemp",
"name": "eco temperature", "name": "eco temperature",
"type": "double", "type": "double",
"index": 1,
"unit": "DegreeCelsius", "unit": "DegreeCelsius",
"defaultValue": 0 "defaultValue": 0
}, },
@ -146,6 +167,7 @@
"idName": "maxSetpointTemp", "idName": "maxSetpointTemp",
"name": "max setpoint", "name": "max setpoint",
"type": "double", "type": "double",
"index": 2,
"unit": "DegreeCelsius", "unit": "DegreeCelsius",
"defaultValue": 0 "defaultValue": 0
}, },
@ -154,6 +176,7 @@
"idName": "minSetpointTemp", "idName": "minSetpointTemp",
"name": "min setpoint", "name": "min setpoint",
"type": "double", "type": "double",
"index": 3,
"unit": "DegreeCelsius", "unit": "DegreeCelsius",
"defaultValue": 0 "defaultValue": 0
}, },
@ -162,6 +185,7 @@
"idName": "errorOccurred", "idName": "errorOccurred",
"name": "error occurred", "name": "error occurred",
"type": "bool", "type": "bool",
"index": 4,
"defaultValue": false "defaultValue": false
}, },
{ {
@ -169,6 +193,7 @@
"idName": "initialized", "idName": "initialized",
"name": "initialized", "name": "initialized",
"type": "bool", "type": "bool",
"index": 5,
"defaultValue": false "defaultValue": false
}, },
{ {
@ -176,6 +201,7 @@
"idName": "batteryLow", "idName": "batteryLow",
"name": "battery low", "name": "battery low",
"type": "bool", "type": "bool",
"index": 6,
"defaultValue": false "defaultValue": false
}, },
{ {
@ -183,6 +209,7 @@
"idName": "linkStatusOK", "idName": "linkStatusOK",
"name": "link status ok", "name": "link status ok",
"type": "bool", "type": "bool",
"index": 7,
"defaultValue": false "defaultValue": false
}, },
{ {
@ -190,6 +217,7 @@
"idName": "panelLocked", "idName": "panelLocked",
"name": "panel locked", "name": "panel locked",
"type": "bool", "type": "bool",
"index": 8,
"defaultValue": false "defaultValue": false
}, },
{ {
@ -197,6 +225,7 @@
"idName": "gatewayKnown", "idName": "gatewayKnown",
"name": "gateway known", "name": "gateway known",
"type": "bool", "type": "bool",
"index": 9,
"defaultValue": false "defaultValue": false
}, },
{ {
@ -204,6 +233,7 @@
"idName": "dtsActive", "idName": "dtsActive",
"name": "dts active", "name": "dts active",
"type": "bool", "type": "bool",
"index": 10,
"defaultValue": false "defaultValue": false
}, },
{ {
@ -211,12 +241,14 @@
"idName": "deviceMode", "idName": "deviceMode",
"name": "device mode", "name": "device mode",
"type": "int", "type": "int",
"index": 11,
"defaultValue": -1 "defaultValue": -1
}, },
{ {
"id": "ff5194e3-5641-4ac2-92c7-48c431b4a2eb", "id": "ff5194e3-5641-4ac2-92c7-48c431b4a2eb",
"idName": "deviceModeString", "idName": "deviceModeString",
"name": "device mode string", "name": "device mode string",
"index": 12,
"type": "QString" "type": "QString"
}, },
{ {
@ -225,6 +257,7 @@
"name": "desired temperature", "name": "desired temperature",
"type": "double", "type": "double",
"unit": "DegreeCelsius", "unit": "DegreeCelsius",
"index": 13,
"defaultValue": 0, "defaultValue": 0,
"writable": true "writable": true
@ -234,6 +267,7 @@
"idName": "currentTemperature", "idName": "currentTemperature",
"name": "current temp", "name": "current temp",
"unit": "DegreeCelsius", "unit": "DegreeCelsius",
"index": 14,
"type": "double", "type": "double",
"defaultValue": 0 "defaultValue": 0
} }
@ -254,44 +288,53 @@
"paramTypes": [ "paramTypes": [
{ {
"name": "serial number", "name": "serial number",
"type": "QString" "type": "QString",
"index": 0
}, },
{ {
"name": "name", "name": "name",
"type": "QString" "type": "QString",
"index": 1
}, },
{ {
"name": "parent cube", "name": "parent cube",
"type": "QString" "type": "QString",
"index": 2
}, },
{ {
"name": "rf address", "name": "rf address",
"type": "QString" "type": "QString",
"index": 3
}, },
{ {
"name": "room id", "name": "room id",
"type": "int" "type": "int",
"index": 4
}, },
{ {
"name": "room name", "name": "room name",
"type": "QString" "type": "QString",
"index": 5
} }
], ],
"actionTypes": [ "actionTypes": [
{ {
"id": "162b4b3d-9923-4f2c-a755-b50c8a06a6f0", "id": "162b4b3d-9923-4f2c-a755-b50c8a06a6f0",
"idName": "setAutoMode", "idName": "setAutoMode",
"name": "set auto mode" "name": "set auto mode",
"index": 0
}, },
{ {
"id": "8e604437-9f5b-4c17-b5b0-e2db6007af5b", "id": "8e604437-9f5b-4c17-b5b0-e2db6007af5b",
"idName": "setManualMode", "idName": "setManualMode",
"name": "set manual mode" "name": "set manual mode",
"index": 1
}, },
{ {
"id": "27a981e8-ec23-4ba8-921e-33b911a7dd89", "id": "27a981e8-ec23-4ba8-921e-33b911a7dd89",
"idName": "setEcoMode", "idName": "setEcoMode",
"name": "set eco mode" "name": "set eco mode",
"index": 2
} }
], ],
"stateTypes": [ "stateTypes": [
@ -301,7 +344,8 @@
"name": "comfort temperature", "name": "comfort temperature",
"unit": "DegreeCelsius", "unit": "DegreeCelsius",
"type": "double", "type": "double",
"defaultValue": 0 "defaultValue": 0,
"index": 0
}, },
{ {
"id": "24dfd20d-bc8d-48e4-8162-b20ae0465c41", "id": "24dfd20d-bc8d-48e4-8162-b20ae0465c41",
@ -309,7 +353,8 @@
"name": "eco temperature", "name": "eco temperature",
"unit": "DegreeCelsius", "unit": "DegreeCelsius",
"type": "double", "type": "double",
"defaultValue": 0 "defaultValue": 0,
"index": 1
}, },
{ {
"id": "a8536ddf-a6e4-41c2-89c1-e7102608f5f6", "id": "a8536ddf-a6e4-41c2-89c1-e7102608f5f6",
@ -317,7 +362,8 @@
"name": "max setpoint", "name": "max setpoint",
"unit": "DegreeCelsius", "unit": "DegreeCelsius",
"type": "double", "type": "double",
"defaultValue": 0 "defaultValue": 0,
"index": 2
}, },
{ {
"id": "ceb0ad05-37ad-4b79-a4d9-540c34a7e3e4", "id": "ceb0ad05-37ad-4b79-a4d9-540c34a7e3e4",
@ -325,69 +371,79 @@
"name": "min setpoint", "name": "min setpoint",
"unit": "DegreeCelsius", "unit": "DegreeCelsius",
"type": "double", "type": "double",
"defaultValue": 0 "defaultValue": 0,
"index": 3
}, },
{ {
"id": "9880247b-cf9a-453c-b0c3-d910eba8a253", "id": "9880247b-cf9a-453c-b0c3-d910eba8a253",
"idName": "errorOccurred", "idName": "errorOccurred",
"name": "error occured", "name": "error occured",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false,
"index": 4
}, },
{ {
"id": "a9e29f03-063e-4686-8aac-2f6d8f8a4937", "id": "a9e29f03-063e-4686-8aac-2f6d8f8a4937",
"idName": "initialized", "idName": "initialized",
"name": "initialized", "name": "initialized",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false,
"index": 5
}, },
{ {
"id": "53b89f32-8894-4290-92a0-6a470c6b69ab", "id": "53b89f32-8894-4290-92a0-6a470c6b69ab",
"idName": "batteryLow", "idName": "batteryLow",
"name": "battery low", "name": "battery low",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false,
"index": 6
}, },
{ {
"id": "aff38be8-7ea6-4fd8-b0fa-e987ab05c719", "id": "aff38be8-7ea6-4fd8-b0fa-e987ab05c719",
"idName": "batteryLow", "idName": "batteryLow",
"name": "link status ok", "name": "link status ok",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false,
"index": 7
}, },
{ {
"id": "979df197-09a1-46f9-9217-9d323b1062bd", "id": "979df197-09a1-46f9-9217-9d323b1062bd",
"idName": "panelLocked", "idName": "panelLocked",
"name": "panel locked", "name": "panel locked",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false,
"index": 8
}, },
{ {
"id": "1d6bd962-5c31-47ad-80a4-dda87bff98f5", "id": "1d6bd962-5c31-47ad-80a4-dda87bff98f5",
"idName": "gatewayKnown", "idName": "gatewayKnown",
"name": "gateway known", "name": "gateway known",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false,
"index": 9
}, },
{ {
"id": "1b402ba6-a8ae-45b1-8acf-2b0a89f71889", "id": "1b402ba6-a8ae-45b1-8acf-2b0a89f71889",
"idName": "dtsActive", "idName": "dtsActive",
"name": "dts active", "name": "dts active",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false,
"index": 10
}, },
{ {
"id": "639360f0-bb65-43e6-b227-50ae0ac39d6c", "id": "639360f0-bb65-43e6-b227-50ae0ac39d6c",
"idName": "deviceMode", "idName": "deviceMode",
"name": "device mode", "name": "device mode",
"type": "int", "type": "int",
"defaultValue": -1 "defaultValue": -1,
"index": 11
}, },
{ {
"id": "ff5194e3-5641-4ac2-92c7-48c431b4a2eb", "id": "ff5194e3-5641-4ac2-92c7-48c431b4a2eb",
"idName": "deviceModeString", "idName": "deviceModeString",
"name": "device mode string", "name": "device mode string",
"type": "QString" "type": "QString",
"index": 12
}, },
{ {
"id": "579aa8c6-8814-491b-9e7c-b98108c323d1", "id": "579aa8c6-8814-491b-9e7c-b98108c323d1",
@ -396,7 +452,8 @@
"unit": "DegreeCelsius", "unit": "DegreeCelsius",
"type": "double", "type": "double",
"defaultValue": 0, "defaultValue": 0,
"writable": true "writable": true,
"index": 13
}, },
{ {
"id": "576da571-9a65-478f-96bf-19256c8b9ece", "id": "576da571-9a65-478f-96bf-19256c8b9ece",
@ -404,7 +461,8 @@
"name": "offset temperature", "name": "offset temperature",
"unit": "DegreeCelsius", "unit": "DegreeCelsius",
"type": "double", "type": "double",
"defaultValue": 0 "defaultValue": 0,
"index": 14
}, },
{ {
"id": "81c6c74a-b0cd-4daa-9eb9-f1cd68f328af", "id": "81c6c74a-b0cd-4daa-9eb9-f1cd68f328af",
@ -412,14 +470,16 @@
"name": "window open duration", "name": "window open duration",
"unit": "Minutes", "unit": "Minutes",
"type": "int", "type": "int",
"defaultValue": 0 "defaultValue": 0,
"index": 15
}, },
{ {
"id": "7c41fa64-b1a1-48d2-9d03-67aa16cd83ad", "id": "7c41fa64-b1a1-48d2-9d03-67aa16cd83ad",
"idName": "boostValveValue", "idName": "boostValveValue",
"name": "boost valve value", "name": "boost valve value",
"type": "int", "type": "int",
"defaultValue": 0 "defaultValue": 0,
"index": 16
}, },
{ {
"id": "e75c1398-9ad7-466c-b3b9-b03bbb686a30", "id": "e75c1398-9ad7-466c-b3b9-b03bbb686a30",
@ -427,28 +487,32 @@
"name": "boost duration", "name": "boost duration",
"unit": "Seconds", "unit": "Seconds",
"type": "int", "type": "int",
"defaultValue": 0 "defaultValue": 0,
"index": 17
}, },
{ {
"id": "bd6f5947-d4b4-444b-81c8-77eec46957e4", "id": "bd6f5947-d4b4-444b-81c8-77eec46957e4",
"idName": "discalcWeekDay", "idName": "discalcWeekDay",
"name": "discalc weekday", "name": "discalc weekday",
"type": "QString", "type": "QString",
"defaultValue": "" "defaultValue": "",
"index": 18
}, },
{ {
"id": "e78235ee-affc-41e3-a463-9f0512b4a6c3", "id": "e78235ee-affc-41e3-a463-9f0512b4a6c3",
"idName": "discalcTime", "idName": "discalcTime",
"name": "discalc time", "name": "discalc time",
"type": "QString", "type": "QString",
"defaultValue": "" "defaultValue": "",
"index": 19
}, },
{ {
"id": "e367fa3a-b30f-49bd-af3f-cff92360ad32", "id": "e367fa3a-b30f-49bd-af3f-cff92360ad32",
"idName": "valveMaximumSettings", "idName": "valveMaximumSettings",
"name": "valve maximum setting", "name": "valve maximum setting",
"type": "double", "type": "double",
"defaultValue": 0 "defaultValue": 0,
"index": 20
}, },
{ {
"id": "ffaff87b-b741-4db8-9875-3380af4f1885", "id": "ffaff87b-b741-4db8-9875-3380af4f1885",
@ -456,7 +520,8 @@
"name": "valve offset", "name": "valve offset",
"unit": "Percentage", "unit": "Percentage",
"type": "int", "type": "int",
"defaultValue": 0 "defaultValue": 0,
"index": 21
}, },
{ {
"id": "72956000-0203-4c32-a6b6-3bb7e46c03ca", "id": "72956000-0203-4c32-a6b6-3bb7e46c03ca",
@ -464,7 +529,8 @@
"name": "valve position", "name": "valve position",
"unit": "Percentage", "unit": "Percentage",
"type": "int", "type": "int",
"defaultValue": 0 "defaultValue": 0,
"index": 22
} }
] ]
} }

View File

@ -13,6 +13,7 @@
"idName": "toggleButton", "idName": "toggleButton",
"name": "Toggle Button", "name": "Toggle Button",
"deviceIcon": "Switch", "deviceIcon": "Switch",
"primaryActionTypeId": "b5e90567-54aa-49bd-a78a-3c19fb38aaf5",
"basicTags": [ "basicTags": [
"Device", "Device",
"Actuator" "Actuator"
@ -24,6 +25,7 @@
"id": "b5e90567-54aa-49bd-a78a-3c19fb38aaf5", "id": "b5e90567-54aa-49bd-a78a-3c19fb38aaf5",
"idName": "state", "idName": "state",
"name": "state", "name": "state",
"index": 0,
"type": "bool", "type": "bool",
"defaultValue": false, "defaultValue": false,
"writable": true "writable": true
@ -35,6 +37,7 @@
"idName": "button", "idName": "button",
"name": "Button", "name": "Button",
"deviceIcon": "Switch", "deviceIcon": "Switch",
"primaryActionTypeId": "01f38af1-b2ab-4ec3-844e-ef52f0f229a9",
"basicTags": [ "basicTags": [
"Device", "Device",
"Actuator" "Actuator"
@ -45,6 +48,7 @@
{ {
"id": "01f38af1-b2ab-4ec3-844e-ef52f0f229a9", "id": "01f38af1-b2ab-4ec3-844e-ef52f0f229a9",
"idName": "buttonPress", "idName": "buttonPress",
"index": 0,
"name": "press" "name": "press"
} }
], ],
@ -52,6 +56,7 @@
{ {
"id": "effdbc2d-e467-4b0b-80a9-9dda251bfa5c", "id": "effdbc2d-e467-4b0b-80a9-9dda251bfa5c",
"idName": "buttonPressed", "idName": "buttonPressed",
"index": 0,
"name": "button pressed" "name": "button pressed"
} }
] ]
@ -71,11 +76,13 @@
{ {
"id": "892596d2-0863-4807-97da-469b9f7003f2", "id": "892596d2-0863-4807-97da-469b9f7003f2",
"idName": "onOffButtonOn", "idName": "onOffButtonOn",
"index": 0,
"name": "press ON" "name": "press ON"
}, },
{ {
"id": "a8d64050-0b58-4ccf-b052-77ce2b7368ad", "id": "a8d64050-0b58-4ccf-b052-77ce2b7368ad",
"idName": "onOffButtonOff", "idName": "onOffButtonOff",
"index": 1,
"name": "press OFF" "name": "press OFF"
} }
], ],
@ -83,11 +90,13 @@
{ {
"id": "4eeba6a2-e4c7-4a2e-8360-2797d98114e6", "id": "4eeba6a2-e4c7-4a2e-8360-2797d98114e6",
"idName": "onOffButtonOn", "idName": "onOffButtonOn",
"index": 0,
"name": "ON pressed" "name": "ON pressed"
}, },
{ {
"id": "b636c5f3-2eb0-4682-96d4-88a4aa9d2c12", "id": "b636c5f3-2eb0-4682-96d4-88a4aa9d2c12",
"idName": "onOffButtonOff", "idName": "onOffButtonOff",
"index": 1,
"name": "OFF pressed" "name": "OFF pressed"
} }
] ]

View File

@ -13,6 +13,7 @@
"name": "Intertechno switch", "name": "Intertechno switch",
"createMethods": ["user"], "createMethods": ["user"],
"deviceIcon": "Switch", "deviceIcon": "Switch",
"primaryActionTypeId": "df19fb51-c3cd-4b95-8d88-ebbb535f4789",
"basicTags": [ "basicTags": [
"Device", "Device",
"Actuator" "Actuator"
@ -21,11 +22,13 @@
{ {
"name": "family code", "name": "family code",
"type": "QString", "type": "QString",
"index": 0,
"allowedValues": ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P"] "allowedValues": ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P"]
}, },
{ {
"name": "button code", "name": "button code",
"type": "int", "type": "int",
"index": 1,
"minValue": 1, "minValue": 1,
"maxValue": 16 "maxValue": 16
} }
@ -34,6 +37,7 @@
{ {
"id": "df19fb51-c3cd-4b95-8d88-ebbb535f4789", "id": "df19fb51-c3cd-4b95-8d88-ebbb535f4789",
"name": "set power", "name": "set power",
"index": 0,
"paramTypes": [ "paramTypes": [
{ {
"name": "power", "name": "power",

View File

@ -19,19 +19,23 @@
"Actuator" "Actuator"
], ],
"createMethods": ["user", "discovery"], "createMethods": ["user", "discovery"],
"criticalStateTypeId": "09dfbd40-c97c-4a20-9ecd-f80e389a4864",
"paramTypes": [ "paramTypes": [
{ {
"name": "name", "name": "name",
"type": "QString", "type": "QString",
"index": 0,
"inputType": "TextLine" "inputType": "TextLine"
}, },
{ {
"name": "ip", "name": "ip",
"type" : "QString", "type" : "QString",
"index": 1,
"inputType": "IPv4Address" "inputType": "IPv4Address"
}, },
{ {
"name": "port", "name": "port",
"index": 2,
"type" : "int" "type" : "int"
} }
], ],
@ -40,12 +44,14 @@
"id": "09dfbd40-c97c-4a20-9ecd-f80e389a4864", "id": "09dfbd40-c97c-4a20-9ecd-f80e389a4864",
"idName": "connected", "idName": "connected",
"name": "connected", "name": "connected",
"index": 0,
"type": "bool" "type": "bool"
}, },
{ {
"id": "bc98cdb0-4d0e-48ca-afc7-922e49bb7813", "id": "bc98cdb0-4d0e-48ca-afc7-922e49bb7813",
"idName": "mute", "idName": "mute",
"name": "mute", "name": "mute",
"index": 1,
"type": "bool", "type": "bool",
"writable": true "writable": true
}, },
@ -55,6 +61,7 @@
"name": "volume", "name": "volume",
"unit": "Percentage", "unit": "Percentage",
"type": "int", "type": "int",
"index": 2,
"minValue": 0, "minValue": 0,
"maxValue": 100, "maxValue": 100,
"writable": true "writable": true
@ -64,16 +71,19 @@
{ {
"id": "2535a1eb-7643-4874-98f6-b027fdff6311", "id": "2535a1eb-7643-4874-98f6-b027fdff6311",
"idName": "onPlayerPlay", "idName": "onPlayerPlay",
"index": 0,
"name": "player play" "name": "player play"
}, },
{ {
"id": "99498b1c-e9c0-480a-9e91-662ee79ba976", "id": "99498b1c-e9c0-480a-9e91-662ee79ba976",
"idName": "onPlayerPause", "idName": "onPlayerPause",
"index": 1,
"name": "player pause" "name": "player pause"
}, },
{ {
"id": "a02ce255-3abb-435d-a92e-7f99c952ecb2", "id": "a02ce255-3abb-435d-a92e-7f99c952ecb2",
"idName": "onPlayerStop", "idName": "onPlayerStop",
"index": 2,
"name": "player stop" "name": "player stop"
} }
], ],
@ -82,15 +92,18 @@
"id": "dc0aa3b5-4eae-4e58-a4ac-d4c124da53f1", "id": "dc0aa3b5-4eae-4e58-a4ac-d4c124da53f1",
"idName": "showNotification", "idName": "showNotification",
"name": "show notification", "name": "show notification",
"index": 0,
"paramTypes": [ "paramTypes": [
{ {
"name": "message", "name": "message",
"type": "QString", "type": "QString",
"index": 0,
"inputType": "TextLine" "inputType": "TextLine"
}, },
{ {
"name": "type", "name": "type",
"type": "QString", "type": "QString",
"index": 1,
"defaultValue": "info", "defaultValue": "info",
"allowedValues": [ "allowedValues": [
"info", "info",
@ -104,10 +117,12 @@
"id": "28060803-aa85-44a4-9dec-ee669dfb629f", "id": "28060803-aa85-44a4-9dec-ee669dfb629f",
"idName": "pressButton", "idName": "pressButton",
"name": "press button", "name": "press button",
"index": 1,
"paramTypes": [ "paramTypes": [
{ {
"name": "button", "name": "button",
"type": "QString", "type": "QString",
"index": 0,
"allowedValues": [ "allowedValues": [
"left", "left",
"right", "right",
@ -147,10 +162,12 @@
"id": "8d51cd64-ecef-44f8-85b0-697bef252ce5", "id": "8d51cd64-ecef-44f8-85b0-697bef252ce5",
"idName": "system", "idName": "system",
"name": "system", "name": "system",
"index": 2,
"paramTypes": [ "paramTypes": [
{ {
"name": "command", "name": "command",
"type": "QString", "type": "QString",
"index": 0,
"defaultValue": "shutdown", "defaultValue": "shutdown",
"allowedValues": [ "allowedValues": [
"hibernate", "hibernate",
@ -165,10 +182,12 @@
"id": "59f7ad10-16eb-40b7-a88b-c8393ae8e413", "id": "59f7ad10-16eb-40b7-a88b-c8393ae8e413",
"idName": "videoLibrary", "idName": "videoLibrary",
"name": "video library", "name": "video library",
"index": 3,
"paramTypes": [ "paramTypes": [
{ {
"name": "command", "name": "command",
"type": "QString", "type": "QString",
"index": 0,
"defaultValue": "scan", "defaultValue": "scan",
"allowedValues": [ "allowedValues": [
"scan", "scan",
@ -181,10 +200,12 @@
"id": "3d5120eb-1007-46c3-b76e-d9d4b105b9f2", "id": "3d5120eb-1007-46c3-b76e-d9d4b105b9f2",
"idName": "audioLibrary", "idName": "audioLibrary",
"name": "audio library", "name": "audio library",
"index": 4,
"paramTypes": [ "paramTypes": [
{ {
"name": "command", "name": "command",
"type": "QString", "type": "QString",
"index": 0,
"defaultValue": "scan", "defaultValue": "scan",
"allowedValues": [ "allowedValues": [
"scan", "scan",

View File

@ -135,6 +135,7 @@ void JsonTypes::init()
// ParamType // ParamType
s_paramType.insert("name", basicTypeToString(String)); s_paramType.insert("name", basicTypeToString(String));
s_paramType.insert("type", basicTypeRef()); s_paramType.insert("type", basicTypeRef());
s_paramType.insert("index", basicTypeToString(Int));
s_paramType.insert("o:defaultValue", basicTypeToString(Variant)); s_paramType.insert("o:defaultValue", basicTypeToString(Variant));
s_paramType.insert("o:minValue", basicTypeToString(Variant)); s_paramType.insert("o:minValue", basicTypeToString(Variant));
s_paramType.insert("o:maxValue", basicTypeToString(Variant)); s_paramType.insert("o:maxValue", basicTypeToString(Variant));
@ -167,6 +168,7 @@ void JsonTypes::init()
s_stateType.insert("id", basicTypeToString(Uuid)); s_stateType.insert("id", basicTypeToString(Uuid));
s_stateType.insert("name", basicTypeToString(String)); s_stateType.insert("name", basicTypeToString(String));
s_stateType.insert("type", basicTypeRef()); s_stateType.insert("type", basicTypeRef());
s_stateType.insert("index", basicTypeToString(Int));
s_stateType.insert("defaultValue", basicTypeToString(Variant)); s_stateType.insert("defaultValue", basicTypeToString(Variant));
s_stateType.insert("o:unit", unitRef()); s_stateType.insert("o:unit", unitRef());
s_stateType.insert("o:minValue", basicTypeToString(Variant)); s_stateType.insert("o:minValue", basicTypeToString(Variant));
@ -192,27 +194,29 @@ void JsonTypes::init()
// EventType // EventType
s_eventType.insert("id", basicTypeToString(Uuid)); s_eventType.insert("id", basicTypeToString(Uuid));
s_eventType.insert("name", basicTypeToString(String)); s_eventType.insert("name", basicTypeToString(String));
s_eventType.insert("index", basicTypeToString(Int));
s_eventType.insert("paramTypes", QVariantList() << paramTypeRef()); s_eventType.insert("paramTypes", QVariantList() << paramTypeRef());
// Event // Event
s_event.insert("eventTypeId", basicTypeToString(Uuid)); s_event.insert("eventTypeId", basicTypeToString(Uuid));
s_event.insert("deviceId", basicTypeToString(Uuid)); s_event.insert("deviceId", basicTypeToString(Uuid));
s_event.insert("o:params", QVariantList() << paramRef()); s_event.insert("params", QVariantList() << paramRef());
// EventDescriptor // EventDescriptor
s_eventDescriptor.insert("eventTypeId", basicTypeToString(Uuid)); s_eventDescriptor.insert("eventTypeId", basicTypeToString(Uuid));
s_eventDescriptor.insert("deviceId", basicTypeToString(Uuid)); s_eventDescriptor.insert("deviceId", basicTypeToString(Uuid));
s_eventDescriptor.insert("o:paramDescriptors", QVariantList() << paramDescriptorRef()); s_eventDescriptor.insert("paramDescriptors", QVariantList() << paramDescriptorRef());
// ActionType // ActionType
s_actionType.insert("id", basicTypeToString(Uuid)); s_actionType.insert("id", basicTypeToString(Uuid));
s_actionType.insert("name", basicTypeToString(Uuid)); s_actionType.insert("name", basicTypeToString(Uuid));
s_actionType.insert("paramTypes", QVariantList() << paramTypeRef()); s_actionType.insert("index", basicTypeToString(Int));
s_actionType.insert("o:paramTypes", QVariantList() << paramTypeRef());
// Action // Action
s_action.insert("actionTypeId", basicTypeToString(Uuid)); s_action.insert("actionTypeId", basicTypeToString(Uuid));
s_action.insert("deviceId", basicTypeToString(Uuid)); s_action.insert("deviceId", basicTypeToString(Uuid));
s_action.insert("o:params", QVariantList() << paramRef()); s_action.insert("params", QVariantList() << paramRef());
// Pugin // Pugin
s_plugin.insert("id", basicTypeToString(Uuid)); s_plugin.insert("id", basicTypeToString(Uuid));
@ -230,13 +234,16 @@ void JsonTypes::init()
s_deviceClass.insert("name", basicTypeToString(String)); s_deviceClass.insert("name", basicTypeToString(String));
s_deviceClass.insert("deviceIcon", deviceIconRef()); s_deviceClass.insert("deviceIcon", deviceIconRef());
s_deviceClass.insert("basicTags", QVariantList() << basicTagRef()); s_deviceClass.insert("basicTags", QVariantList() << basicTagRef());
s_deviceClass.insert("setupMethod", setupMethodRef());
s_deviceClass.insert("createMethods", QVariantList() << createMethodRef());
s_deviceClass.insert("o:criticalStateTypeId", basicTypeToString(Uuid));
s_deviceClass.insert("o:primaryStateTypeId", basicTypeToString(Uuid));
s_deviceClass.insert("o:primaryActionTypeId", basicTypeToString(Uuid));
s_deviceClass.insert("stateTypes", QVariantList() << stateTypeRef()); s_deviceClass.insert("stateTypes", QVariantList() << stateTypeRef());
s_deviceClass.insert("eventTypes", QVariantList() << eventTypeRef()); s_deviceClass.insert("eventTypes", QVariantList() << eventTypeRef());
s_deviceClass.insert("actionTypes", QVariantList() << actionTypeRef()); s_deviceClass.insert("actionTypes", QVariantList() << actionTypeRef());
s_deviceClass.insert("paramTypes", QVariantList() << paramTypeRef()); s_deviceClass.insert("paramTypes", QVariantList() << paramTypeRef());
s_deviceClass.insert("discoveryParamTypes", QVariantList() << paramTypeRef()); s_deviceClass.insert("discoveryParamTypes", QVariantList() << paramTypeRef());
s_deviceClass.insert("setupMethod", setupMethodRef());
s_deviceClass.insert("createMethods", QVariantList() << createMethodRef());
// Device // Device
s_device.insert("id", basicTypeToString(Uuid)); s_device.insert("id", basicTypeToString(Uuid));
@ -384,6 +391,7 @@ QVariantMap JsonTypes::packEventType(const EventType &eventType)
QVariantMap variant; QVariantMap variant;
variant.insert("id", eventType.id()); variant.insert("id", eventType.id());
variant.insert("name", eventType.name()); variant.insert("name", eventType.name());
variant.insert("index", eventType.index());
QVariantList paramTypes; QVariantList paramTypes;
foreach (const ParamType &paramType, eventType.paramTypes()) { foreach (const ParamType &paramType, eventType.paramTypes()) {
paramTypes.append(packParamType(paramType)); paramTypes.append(packParamType(paramType));
@ -426,6 +434,7 @@ QVariantMap JsonTypes::packActionType(const ActionType &actionType)
QVariantMap variantMap; QVariantMap variantMap;
variantMap.insert("id", actionType.id()); variantMap.insert("id", actionType.id());
variantMap.insert("name", actionType.name()); variantMap.insert("name", actionType.name());
variantMap.insert("index", actionType.index());
QVariantList paramTypes; QVariantList paramTypes;
foreach (const ParamType &paramType, actionType.paramTypes()) { foreach (const ParamType &paramType, actionType.paramTypes()) {
paramTypes.append(packParamType(paramType)); paramTypes.append(packParamType(paramType));
@ -492,6 +501,7 @@ QVariantMap JsonTypes::packStateType(const StateType &stateType)
QVariantMap variantMap; QVariantMap variantMap;
variantMap.insert("id", stateType.id()); variantMap.insert("id", stateType.id());
variantMap.insert("name", stateType.name()); variantMap.insert("name", stateType.name());
variantMap.insert("index", stateType.index());
variantMap.insert("type", basicTypeToString(stateType.type())); variantMap.insert("type", basicTypeToString(stateType.type()));
variantMap.insert("defaultValue", stateType.defaultValue()); variantMap.insert("defaultValue", stateType.defaultValue());
@ -568,7 +578,9 @@ QVariantMap JsonTypes::packParamType(const ParamType &paramType)
QVariantMap variantMap; QVariantMap variantMap;
variantMap.insert("name", paramType.name()); variantMap.insert("name", paramType.name());
variantMap.insert("type", basicTypeToString(paramType.type())); variantMap.insert("type", basicTypeToString(paramType.type()));
// optional variantMap.insert("index", paramType.index());
// Optional values
if (paramType.defaultValue().isValid()) { if (paramType.defaultValue().isValid()) {
variantMap.insert("defaultValue", paramType.defaultValue()); variantMap.insert("defaultValue", paramType.defaultValue());
} }
@ -587,7 +599,6 @@ QVariantMap JsonTypes::packParamType(const ParamType &paramType)
if (paramType.unit() != Types::UnitNone) { if (paramType.unit() != Types::UnitNone) {
variantMap.insert("unit", s_unit.at(paramType.unit())); variantMap.insert("unit", s_unit.at(paramType.unit()));
} }
// only add if this param is NOT writable
if (paramType.readOnly()) { if (paramType.readOnly()) {
variantMap.insert("readOnly", paramType.readOnly()); variantMap.insert("readOnly", paramType.readOnly());
} }
@ -638,6 +649,15 @@ QVariantMap JsonTypes::packDeviceClass(const DeviceClass &deviceClass)
discoveryParamTypes.append(packParamType(paramType)); discoveryParamTypes.append(packParamType(paramType));
} }
if (!deviceClass.criticalStateTypeId().isNull())
variant.insert("criticalStateTypeId", deviceClass.criticalStateTypeId());
if (!deviceClass.primaryStateTypeId().isNull())
variant.insert("primaryStateTypeId", deviceClass.primaryStateTypeId());
if (!deviceClass.primaryActionTypeId().isNull())
variant.insert("primaryActionTypeId", deviceClass.primaryActionTypeId());
variant.insert("basicTags", basicTags); variant.insert("basicTags", basicTags);
variant.insert("paramTypes", paramTypes); variant.insert("paramTypes", paramTypes);
variant.insert("discoveryParamTypes", discoveryParamTypes); variant.insert("discoveryParamTypes", discoveryParamTypes);