generate an include file with uuids from json

This commit is contained in:
Michael Zanetti 2014-12-13 21:34:00 +01:00 committed by Michael Zanetti
parent f75c7abde4
commit 73231419a9
39 changed files with 294 additions and 229 deletions

View File

@ -22,14 +22,11 @@
#include "devicemanager.h" #include "devicemanager.h"
#include "bobclient.h" #include "bobclient.h"
#include "plugininfo.h"
#include <QDebug> #include <QDebug>
#include <QStringList> #include <QStringList>
DeviceClassId boblightDeviceClassId = DeviceClassId("1647c61c-db14-461e-8060-8a3533d5d92f");
StateTypeId colorStateTypeId = StateTypeId("97ec80cd-43a9-40fa-93b7-d1580043d981");
ActionTypeId setColorActionTypeId = ActionTypeId("668e1aa3-fa13-49ce-8630-17a5c0a7c34b");
DevicePluginBoblight::DevicePluginBoblight() DevicePluginBoblight::DevicePluginBoblight()
{ {
m_bobClient = new BobClient(this); m_bobClient = new BobClient(this);

View File

@ -8,11 +8,13 @@
"deviceClasses": [ "deviceClasses": [
{ {
"deviceClassId": "1647c61c-db14-461e-8060-8a3533d5d92f", "deviceClassId": "1647c61c-db14-461e-8060-8a3533d5d92f",
"idName": "boblight",
"name": "Boblight", "name": "Boblight",
"createMethods": ["auto"], "createMethods": ["auto"],
"stateTypes": [ "stateTypes": [
{ {
"id": "97ec80cd-43a9-40fa-93b7-d1580043d981", "id": "97ec80cd-43a9-40fa-93b7-d1580043d981",
"idName": "color",
"name": "color", "name": "color",
"type": "QColor", "type": "QColor",
"defaultValue": "#000000" "defaultValue": "#000000"
@ -21,6 +23,7 @@
"actionTypes": [ "actionTypes": [
{ {
"id": "668e1aa3-fa13-49ce-8630-17a5c0a7c34b", "id": "668e1aa3-fa13-49ce-8630-17a5c0a7c34b",
"idName": "setColor",
"name": "Set color", "name": "Set color",
"paramTypes": [ "paramTypes": [
{ {

View File

@ -1,5 +1,4 @@
include (../../plugins.pri) include (../../plugins.pri)
TARGET = $$qtLibraryTarget(guh_deviceplugincommandlauncher) TARGET = $$qtLibraryTarget(guh_deviceplugincommandlauncher)
SOURCES += \ SOURCES += \

View File

@ -20,15 +20,10 @@
#include "plugin/device.h" #include "plugin/device.h"
#include "devicemanager.h" #include "devicemanager.h"
#include "plugininfo.h"
#include <QDebug> #include <QDebug>
DeviceClassId applicationDeviceClassId = DeviceClassId("0f39fe9e-51ea-4230-9646-2482c6234791");
DeviceClassId scriptDeviceClassId = DeviceClassId("96044325-a6fb-47c9-9117-f29c3b327978");
StateTypeId runningStateTypeId = StateTypeId("28d7e933-ff05-4f4c-95a0-482689543de5");
ActionTypeId executeActionTypeId = ActionTypeId("cf52b41d-3108-423c-8907-ca5b4d97cac5");
ActionTypeId killActionTypeId = ActionTypeId("d21b1fed-1dd9-4c5a-a64e-0c6ba94059be");
DevicePluginCommandLauncher::DevicePluginCommandLauncher() DevicePluginCommandLauncher::DevicePluginCommandLauncher()
{ {
} }

View File

@ -8,6 +8,7 @@
"deviceClasses": [ "deviceClasses": [
{ {
"deviceClassId": "0f39fe9e-51ea-4230-9646-2482c6234791", "deviceClassId": "0f39fe9e-51ea-4230-9646-2482c6234791",
"idName": "application",
"name": "Application launcher", "name": "Application launcher",
"createMethods": ["user"], "createMethods": ["user"],
"paramTypes": [ "paramTypes": [
@ -23,6 +24,7 @@
"stateTypes": [ "stateTypes": [
{ {
"id": "28d7e933-ff05-4f4c-95a0-482689543de5", "id": "28d7e933-ff05-4f4c-95a0-482689543de5",
"idName": "running",
"name": "running", "name": "running",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
@ -31,16 +33,19 @@
"actionTypes": [ "actionTypes": [
{ {
"id": "cf52b41d-3108-423c-8907-ca5b4d97cac5", "id": "cf52b41d-3108-423c-8907-ca5b4d97cac5",
"idName": "execute",
"name": "execute" "name": "execute"
}, },
{ {
"id": "d21b1fed-1dd9-4c5a-a64e-0c6ba94059be", "id": "d21b1fed-1dd9-4c5a-a64e-0c6ba94059be",
"idName": "kill",
"name": "kill" "name": "kill"
} }
] ]
}, },
{ {
"deviceClassId": "96044325-a6fb-47c9-9117-f29c3b327978", "deviceClassId": "96044325-a6fb-47c9-9117-f29c3b327978",
"idName": "script",
"name": "Bashscript launcher", "name": "Bashscript launcher",
"createMethods": ["user"], "createMethods": ["user"],
"paramTypes": [ "paramTypes": [

View File

@ -60,9 +60,6 @@
#include <QStringList> #include <QStringList>
DeviceClassId conradRemoteId = DeviceClassId("17cd2492-28ab-4827-ba6e-5ef35be23f1b");
EventTypeId conradRemoteButtonEventTypeId = EventTypeId("1f4050f5-4c90-4799-8d6d-e4069f3a2519");
ActionTypeId conradRemoteActionTypeId = ActionTypeId("2a3638b4-fbd6-4fdb-a3c9-7fa49705d1a3");
DevicePluginConrad::DevicePluginConrad() DevicePluginConrad::DevicePluginConrad()
{ {
} }

View File

@ -21,23 +21,10 @@
#include "plugin/device.h" #include "plugin/device.h"
#include "devicemanager.h" #include "devicemanager.h"
#include "plugininfo.h"
#include <QDebug> #include <QDebug>
DeviceClassId dateTimeDeviceClassId = DeviceClassId("fbf665fb-9aca-423f-a5f2-924e50ebe6ca");
StateTypeId minuteStateTypeId = StateTypeId("4f867051-bc3c-4b55-8493-10ab74c98a49");
StateTypeId hourStateTypeId = StateTypeId("5b19d9de-a533-4b6f-b42c-bf8069e31adc");
StateTypeId dayStateTypeId = StateTypeId("eb5231ea-6a1b-4d7e-a95f-d49e7b25122e");
StateTypeId monthStateTypeId = StateTypeId("fcd8ec96-4488-438a-8b30-58bfe2a7fae2");
StateTypeId monthNameStateTypeId = StateTypeId("a37acc9c-5cfb-4687-adce-e56beb32586f");
StateTypeId monthNameShortStateTypeId = StateTypeId("4d0814f2-60a6-48c4-8b3b-031a099be8e3");
StateTypeId yearStateTypeId = StateTypeId("79d4ae9b-ea27-4346-8229-1d90f1ddfc9d");
StateTypeId weekdayStateTypeId = StateTypeId("452c0388-7fa1-414e-aeb2-8c7c385824b4");
StateTypeId weekdayNameStateTypeId = StateTypeId("f627d052-cee6-4727-b9c6-0e935d41e04a");
StateTypeId weekdayNameShortStateTypeId = StateTypeId("7e8e8e53-a83b-493d-850d-b0407f03463a");
StateTypeId weekendStateTypeId = StateTypeId("4de5b57b-bb1a-4d66-9ce3-22bb280b075d");
DevicePluginDateTime::DevicePluginDateTime() DevicePluginDateTime::DevicePluginDateTime()
{ {
m_timer = new QTimer(this); m_timer = new QTimer(this);

View File

@ -8,6 +8,7 @@
"deviceClasses": [ "deviceClasses": [
{ {
"deviceClassId": "fbf665fb-9aca-423f-a5f2-924e50ebe6ca", "deviceClassId": "fbf665fb-9aca-423f-a5f2-924e50ebe6ca",
"idName": "dateTime",
"name": "Time", "name": "Time",
"createMethods": ["discovery"], "createMethods": ["discovery"],
"discoveryParamTypes": [ "discoveryParamTypes": [
@ -26,12 +27,14 @@
"stateTypes": [ "stateTypes": [
{ {
"id": "4f867051-bc3c-4b55-8493-10ab74c98a49", "id": "4f867051-bc3c-4b55-8493-10ab74c98a49",
"idName": "minute",
"name": "minute", "name": "minute",
"type": "uint", "type": "uint",
"defaultValue": "0" "defaultValue": "0"
}, },
{ {
"id": "5b19d9de-a533-4b6f-b42c-bf8069e31adc", "id": "5b19d9de-a533-4b6f-b42c-bf8069e31adc",
"idName": "hour",
"name": "hour", "name": "hour",
"type": "uint", "type": "uint",
"defaultValue": "0" "defaultValue": "0"
@ -39,53 +42,62 @@
{ {
"id": "eb5231ea-6a1b-4d7e-a95f-d49e7b25122e", "id": "eb5231ea-6a1b-4d7e-a95f-d49e7b25122e",
"name": "day", "name": "day",
"idName": "day",
"type": "uint", "type": "uint",
"defaultValue": "1" "defaultValue": "1"
}, },
{ {
"id": "fcd8ec96-4488-438a-8b30-58bfe2a7fae2", "id": "fcd8ec96-4488-438a-8b30-58bfe2a7fae2",
"name": "month", "name": "month",
"idName": "month",
"type": "uint", "type": "uint",
"defaultValue": "1" "defaultValue": "1"
}, },
{ {
"id": "a37acc9c-5cfb-4687-adce-e56beb32586f", "id": "a37acc9c-5cfb-4687-adce-e56beb32586f",
"idName": "monthName",
"name": "month name", "name": "month name",
"type": "QString", "type": "QString",
"defaultValue": "-" "defaultValue": "-"
}, },
{ {
"id": "4d0814f2-60a6-48c4-8b3b-031a099be8e3", "id": "4d0814f2-60a6-48c4-8b3b-031a099be8e3",
"idName": "monthNameShort",
"name": "month name short", "name": "month name short",
"type": "QString", "type": "QString",
"defaultValue": "-" "defaultValue": "-"
}, },
{ {
"id": "79d4ae9b-ea27-4346-8229-1d90f1ddfc9d", "id": "79d4ae9b-ea27-4346-8229-1d90f1ddfc9d",
"idName": "year",
"name": "year", "name": "year",
"type": "uint", "type": "uint",
"defaultValue": "1970" "defaultValue": "1970"
}, },
{ {
"id": "452c0388-7fa1-414e-aeb2-8c7c385824b4", "id": "452c0388-7fa1-414e-aeb2-8c7c385824b4",
"idName": "weekday",
"name": "weekday", "name": "weekday",
"type": "int", "type": "int",
"defaultValue": "1" "defaultValue": "1"
}, },
{ {
"id": "f627d052-cee6-4727-b9c6-0e935d41e04a", "id": "f627d052-cee6-4727-b9c6-0e935d41e04a",
"idName": "weekdayName",
"name": "weekday name", "name": "weekday name",
"type": "QString", "type": "QString",
"defaultValue": "-" "defaultValue": "-"
}, },
{ {
"id": "7e8e8e53-a83b-493d-850d-b0407f03463a", "id": "7e8e8e53-a83b-493d-850d-b0407f03463a",
"idName": "weekdayNameShort",
"name": "weekday name short", "name": "weekday name short",
"type": "QString", "type": "QString",
"defaultValue": "-" "defaultValue": "-"
}, },
{ {
"id": "4de5b57b-bb1a-4d66-9ce3-22bb280b075d", "id": "4de5b57b-bb1a-4d66-9ce3-22bb280b075d",
"idName": "weekend",
"name": "weekend", "name": "weekend",
"type": "bool", "type": "bool",
"defaultValue": "false" "defaultValue": "false"

View File

@ -52,15 +52,11 @@
#include "devicepluginelro.h" #include "devicepluginelro.h"
#include "devicemanager.h" #include "devicemanager.h"
#include "plugininfo.h"
#include <QDebug> #include <QDebug>
#include <QStringList> #include <QStringList>
DeviceClassId elroRemoteId = DeviceClassId("d85c1ef4-197c-4053-8e40-707aa671d302");
DeviceClassId elroSwitchId = DeviceClassId("308ae6e6-38b3-4b3a-a513-3199da2764f8");
DeviceClassId elroMotionDetectorId = DeviceClassId("4c64aee6-7a4f-41f2-b278-edc55f0da0d3");
DevicePluginElro::DevicePluginElro() DevicePluginElro::DevicePluginElro()
{ {
} }
@ -267,7 +263,7 @@ void DevicePluginElro::radioData(const QList<int> &rawData)
} }
Device *device = 0; Device *device = 0;
QList<Device*> deviceList = deviceManager()->findConfiguredDevices(elroRemoteId); QList<Device*> deviceList = deviceManager()->findConfiguredDevices(elroRemoteDeviceClassId);
foreach (Device *dev, deviceList) { foreach (Device *dev, deviceList) {
if (dev->hasParam("channel 1") && dev->paramValue("channel 1").toBool() == group.at(0) && if (dev->hasParam("channel 1") && dev->paramValue("channel 1").toBool() == group.at(0) &&
dev->hasParam("channel 2") && dev->paramValue("channel 2").toBool() == group.at(1) && dev->hasParam("channel 2") && dev->paramValue("channel 2").toBool() == group.at(1) &&

View File

@ -1,4 +1,4 @@
{ {
"name": "Elro", "name": "Elro",
"id": "2b267f81-d9ae-4f4f-89a0-7386b547cfd3", "id": "2b267f81-d9ae-4f4f-89a0-7386b547cfd3",
"vendors": [ "vendors": [
@ -8,6 +8,7 @@
"deviceClasses": [ "deviceClasses": [
{ {
"deviceClassId": "d85c1ef4-197c-4053-8e40-707aa671d302", "deviceClassId": "d85c1ef4-197c-4053-8e40-707aa671d302",
"idName": "elroRemote",
"name": "Elro Remote", "name": "Elro Remote",
"createMethods": ["user"], "createMethods": ["user"],
"paramTypes": [ "paramTypes": [

View File

@ -140,8 +140,8 @@
\li 852e7708-db1d-42d1-96e4-19c13598262c \li 852e7708-db1d-42d1-96e4-19c13598262c
\li double \li double
\row \row
\li confort temperature [Celsius] \li comfort temperature [Celsius]
\li Describes the configured confort temperature. When the device goes into confort mode, \li Describes the configured comfort temperature. When the device goes into comfort mode,
than this will be te setpoint temperature. than this will be te setpoint temperature.
\li 850380ee-a787-43e7-adb8-768a21a6e64d \li 850380ee-a787-43e7-adb8-768a21a6e64d
\li double \li double
@ -184,51 +184,10 @@
#include "plugin/device.h" #include "plugin/device.h"
#include "devicemanager.h" #include "devicemanager.h"
#include "types/param.h" #include "types/param.h"
#include "plugininfo.h"
#include <QDebug> #include <QDebug>
DeviceClassId cubeDeviceClassId = DeviceClassId("1e892268-8bd7-442c-a001-bd4e2e6b2949");
StateTypeId connectionStateTypeId = StateTypeId("d0a9a369-cf8c-47c4-a12e-f2d076bf12fd");
StateTypeId portalEnabeldStateTypeId = StateTypeId("2c2367da-c229-40ed-9d47-a6e73cd6dc3b");
DeviceClassId wallThermostateDeviceClassId = DeviceClassId("ffbfec5d-06e8-4082-b62b-92cc5c3e8c4e");
StateTypeId confortTempStateTypeId = StateTypeId("850380ee-a787-43e7-adb8-768a21a6e64d");
StateTypeId ecoTempStateTypeId = StateTypeId("24dfd20d-bc8d-48e4-8162-b20ae0465c41");
StateTypeId maxSetpointTempStateTypeId = StateTypeId("a8536ddf-a6e4-41c2-89c1-e7102608f5f6");
StateTypeId minSetpointTempStateTypeId = StateTypeId("ceb0ad05-37ad-4b79-a4d9-540c34a7e3e4");
StateTypeId errorOccuredStateTypeId = StateTypeId("9880247b-cf9a-453c-b0c3-d910eba8a253");
StateTypeId initializedStateTypeId = StateTypeId("a9e29f03-063e-4686-8aac-2f6d8f8a4937");
StateTypeId batteryLowStateTypeId = StateTypeId("53b89f32-8894-4290-92a0-6a470c6b69ab");
StateTypeId linkStatusOKStateTypeId = StateTypeId("aff38be8-7ea6-4fd8-b0fa-e987ab05c719");
StateTypeId panelLockedStateTypeId = StateTypeId("979df197-09a1-46f9-9217-9d323b1062bd");
StateTypeId gatewayKnownStateTypeId = StateTypeId("1d6bd962-5c31-47ad-80a4-dda87bff98f5");
StateTypeId dtsActiveStateTypeId = StateTypeId("1b402ba6-a8ae-45b1-8acf-2b0a89f71889");
StateTypeId deviceModeStateTypeId = StateTypeId("639360f0-bb65-43e6-b227-50ae0ac39d6c");
StateTypeId deviceModeStringStateTypeId = StateTypeId("ff5194e3-5641-4ac2-92c7-48c431b4a2eb");
StateTypeId setpointTempStateTypeId = StateTypeId("579aa8c6-8814-491b-9e7c-b98108c323d1");
StateTypeId currentTemperatureStateTypeId = StateTypeId("852e7708-db1d-42d1-96e4-19c13598262c");
ActionTypeId setSetpointTemperatureActionTypeId = ActionTypeId("9c1968ba-39f9-493d-9fe2-848fa86bd2f0");
ActionTypeId setAutoModeActionTypeId = ActionTypeId("162b4b3d-9923-4f2c-a755-b50c8a06a6f0");
ActionTypeId setManuelModeActionTypeId = ActionTypeId("8e604437-9f5b-4c17-b5b0-e2db6007af5b");
ActionTypeId setEcoModeActionTypeId = ActionTypeId("27a981e8-ec23-4ba8-921e-33b911a7dd89");
ActionTypeId displayCurrentTempActionTypeId = ActionTypeId("184fb112-7a03-4560-8634-0257c969c26e");
DeviceClassId radiatorThermostateDeviceClassId = DeviceClassId("f80d9481-4827-45ee-a013-b97b22412d92");
StateTypeId offsetTempStateTypeId = StateTypeId("576da571-9a65-478f-96bf-19256c8b9ece");
StateTypeId windowOpenDurationStateTypeId = StateTypeId("81c6c74a-b0cd-4daa-9eb9-f1cd68f328af");
StateTypeId boostValueValueStateTypeId = StateTypeId("7c41fa64-b1a1-48d2-9d03-67aa16cd83ad");
StateTypeId boostDurationStateTypeId = StateTypeId("e75c1398-9ad7-466c-b3b9-b03bbb686a30");
StateTypeId discalcWeekDayStateTypeId = StateTypeId("bd6f5947-d4b4-444b-81c8-77eec46957e4");
StateTypeId discalcTimeStateTypeId = StateTypeId("e78235ee-affc-41e3-a463-9f0512b4a6c3");
StateTypeId valveMaximumSettingsStateTypeId = StateTypeId("e367fa3a-b30f-49bd-af3f-cff92360ad32");
StateTypeId valveOffsetStateTypeId = StateTypeId("ffaff87b-b741-4db8-9875-3380af4f1885");
StateTypeId valvePositionStateTypeId = StateTypeId("72956000-0203-4c32-a6b6-3bb7e46c03ca");
DevicePluginEQ3::DevicePluginEQ3() DevicePluginEQ3::DevicePluginEQ3()
{ {
m_cubeDiscovery = new MaxCubeDiscovery(this); m_cubeDiscovery = new MaxCubeDiscovery(this);
@ -331,7 +290,7 @@ DeviceManager::DeviceError DevicePluginEQ3::executeAction(Device *device, const
cube->setDeviceSetpointTemp(rfAddress, roomId, action.param("setpoint temperature").value().toDouble(), action.id()); cube->setDeviceSetpointTemp(rfAddress, roomId, action.param("setpoint temperature").value().toDouble(), action.id());
} else if (action.actionTypeId() == setAutoModeActionTypeId){ } else if (action.actionTypeId() == setAutoModeActionTypeId){
cube->setDeviceAutoMode(rfAddress, roomId, action.id()); cube->setDeviceAutoMode(rfAddress, roomId, action.id());
} else if (action.actionTypeId() == setManuelModeActionTypeId){ } else if (action.actionTypeId() == setManualModeActionTypeId){
cube->setDeviceManuelMode(rfAddress, roomId, action.id()); cube->setDeviceManuelMode(rfAddress, roomId, action.id());
} else if (action.actionTypeId() == setEcoModeActionTypeId){ } else if (action.actionTypeId() == setEcoModeActionTypeId){
cube->setDeviceEcoMode(rfAddress, roomId, action.id()); cube->setDeviceEcoMode(rfAddress, roomId, action.id());
@ -471,7 +430,7 @@ void DevicePluginEQ3::updateCubeConfig()
Device *device; Device *device;
if (m_cubes.contains(cube)) { if (m_cubes.contains(cube)) {
device = m_cubes.value(cube); device = m_cubes.value(cube);
device->setStateValue(portalEnabeldStateTypeId,cube->portalEnabeld()); device->setStateValue(portalEnabledStateTypeId,cube->portalEnabeld());
return; return;
} }
} }
@ -483,11 +442,11 @@ void DevicePluginEQ3::wallThermostatDataUpdated()
foreach (WallThermostat *wallThermostat, cube->wallThermostatList()) { foreach (WallThermostat *wallThermostat, cube->wallThermostatList()) {
foreach (Device *device, deviceManager()->findConfiguredDevices(wallThermostateDeviceClassId)){ foreach (Device *device, deviceManager()->findConfiguredDevices(wallThermostateDeviceClassId)){
if(device->paramValue("serial number").toString() == wallThermostat->serialNumber()){ if(device->paramValue("serial number").toString() == wallThermostat->serialNumber()){
device->setStateValue(confortTempStateTypeId, wallThermostat->confortTemp()); device->setStateValue(comfortTempStateTypeId, wallThermostat->comfortTemp());
device->setStateValue(ecoTempStateTypeId, wallThermostat->ecoTemp()); device->setStateValue(ecoTempStateTypeId, wallThermostat->ecoTemp());
device->setStateValue(maxSetpointTempStateTypeId, wallThermostat->maxSetPointTemp()); device->setStateValue(maxSetpointTempStateTypeId, wallThermostat->maxSetPointTemp());
device->setStateValue(minSetpointTempStateTypeId, wallThermostat->minSetPointTemp()); device->setStateValue(minSetpointTempStateTypeId, wallThermostat->minSetPointTemp());
device->setStateValue(errorOccuredStateTypeId, wallThermostat->errorOccured()); device->setStateValue(errorOccurredStateTypeId, wallThermostat->errorOccured());
device->setStateValue(initializedStateTypeId, wallThermostat->initialized()); device->setStateValue(initializedStateTypeId, wallThermostat->initialized());
device->setStateValue(batteryLowStateTypeId, wallThermostat->batteryLow()); device->setStateValue(batteryLowStateTypeId, wallThermostat->batteryLow());
device->setStateValue(linkStatusOKStateTypeId, wallThermostat->linkStatusOK()); device->setStateValue(linkStatusOKStateTypeId, wallThermostat->linkStatusOK());
@ -512,11 +471,11 @@ void DevicePluginEQ3::radiatorThermostatDataUpdated()
foreach (RadiatorThermostat *radiatorThermostat, cube->radiatorThermostatList()) { foreach (RadiatorThermostat *radiatorThermostat, cube->radiatorThermostatList()) {
foreach (Device *device, deviceManager()->findConfiguredDevices(radiatorThermostateDeviceClassId)){ foreach (Device *device, deviceManager()->findConfiguredDevices(radiatorThermostateDeviceClassId)){
if(device->paramValue("serial number").toString() == radiatorThermostat->serialNumber()){ if(device->paramValue("serial number").toString() == radiatorThermostat->serialNumber()){
device->setStateValue(confortTempStateTypeId, radiatorThermostat->confortTemp()); device->setStateValue(comfortTempStateTypeId, radiatorThermostat->comfortTemp());
device->setStateValue(ecoTempStateTypeId, radiatorThermostat->ecoTemp()); device->setStateValue(ecoTempStateTypeId, radiatorThermostat->ecoTemp());
device->setStateValue(maxSetpointTempStateTypeId, radiatorThermostat->maxSetPointTemp()); device->setStateValue(maxSetpointTempStateTypeId, radiatorThermostat->maxSetPointTemp());
device->setStateValue(minSetpointTempStateTypeId, radiatorThermostat->minSetPointTemp()); device->setStateValue(minSetpointTempStateTypeId, radiatorThermostat->minSetPointTemp());
device->setStateValue(errorOccuredStateTypeId, radiatorThermostat->errorOccured()); device->setStateValue(errorOccurredStateTypeId, radiatorThermostat->errorOccured());
device->setStateValue(initializedStateTypeId, radiatorThermostat->initialized()); device->setStateValue(initializedStateTypeId, radiatorThermostat->initialized());
device->setStateValue(batteryLowStateTypeId, radiatorThermostat->batteryLow()); device->setStateValue(batteryLowStateTypeId, radiatorThermostat->batteryLow());
device->setStateValue(linkStatusOKStateTypeId, radiatorThermostat->linkStatusOK()); device->setStateValue(linkStatusOKStateTypeId, radiatorThermostat->linkStatusOK());
@ -528,7 +487,7 @@ void DevicePluginEQ3::radiatorThermostatDataUpdated()
device->setStateValue(setpointTempStateTypeId, radiatorThermostat->setpointTemperature()); device->setStateValue(setpointTempStateTypeId, radiatorThermostat->setpointTemperature());
device->setStateValue(offsetTempStateTypeId, radiatorThermostat->offsetTemp()); device->setStateValue(offsetTempStateTypeId, radiatorThermostat->offsetTemp());
device->setStateValue(windowOpenDurationStateTypeId, radiatorThermostat->windowOpenDuration()); device->setStateValue(windowOpenDurationStateTypeId, radiatorThermostat->windowOpenDuration());
device->setStateValue(boostValueValueStateTypeId, radiatorThermostat->boostValveValue()); device->setStateValue(boostValveValueStateTypeId, radiatorThermostat->boostValveValue());
device->setStateValue(boostDurationStateTypeId, radiatorThermostat->boostDuration()); device->setStateValue(boostDurationStateTypeId, radiatorThermostat->boostDuration());
device->setStateValue(discalcWeekDayStateTypeId, radiatorThermostat->discalcingWeekDay()); device->setStateValue(discalcWeekDayStateTypeId, radiatorThermostat->discalcingWeekDay());
device->setStateValue(discalcTimeStateTypeId, radiatorThermostat->discalcingTime().toString("HH:mm")); device->setStateValue(discalcTimeStateTypeId, radiatorThermostat->discalcingTime().toString("HH:mm"));

View File

@ -8,6 +8,7 @@
"deviceClasses": [ "deviceClasses": [
{ {
"deviceClassId": "1e892268-8bd7-442c-a001-bd4e2e6b2949", "deviceClassId": "1e892268-8bd7-442c-a001-bd4e2e6b2949",
"idName": "cube",
"name": "Max! Cube LAN Gateway", "name": "Max! Cube LAN Gateway",
"createMethods": ["discovery"], "createMethods": ["discovery"],
"paramTypes": [ "paramTypes": [
@ -31,12 +32,14 @@
"stateTypes": [ "stateTypes": [
{ {
"id": "d0a9a369-cf8c-47c4-a12e-f2d076bf12fd", "id": "d0a9a369-cf8c-47c4-a12e-f2d076bf12fd",
"idName": "connection",
"name": "connected", "name": "connected",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
}, },
{ {
"id": "2c2367da-c229-40ed-9d47-a6e73cd6dc3b", "id": "2c2367da-c229-40ed-9d47-a6e73cd6dc3b",
"idName": "portalEnabled",
"name": "portal enabled", "name": "portal enabled",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
@ -45,6 +48,7 @@
}, },
{ {
"deviceClassId": "ffbfec5d-06e8-4082-b62b-92cc5c3e8c4e", "deviceClassId": "ffbfec5d-06e8-4082-b62b-92cc5c3e8c4e",
"idName": "wallThermostate",
"name": "Max! Wall Thermostat", "name": "Max! Wall Thermostat",
"createMethods": ["auto"], "createMethods": ["auto"],
"paramTypes": [ "paramTypes": [
@ -99,6 +103,7 @@
}, },
{ {
"id": "184fb112-7a03-4560-8634-0257c969c26e", "id": "184fb112-7a03-4560-8634-0257c969c26e",
"idName": "displayCurrentTemp",
"name": "display current temperature", "name": "display current temperature",
"paramTypes": [ "paramTypes": [
{ {
@ -112,89 +117,104 @@
"stateTypes": [ "stateTypes": [
{ {
"id": "850380ee-a787-43e7-adb8-768a21a6e64d", "id": "850380ee-a787-43e7-adb8-768a21a6e64d",
"idName": "comfortTemp",
"name": "comfort temperature", "name": "comfort temperature",
"type": "double", "type": "double",
"defaultValue": 0 "defaultValue": 0
}, },
{ {
"id": "24dfd20d-bc8d-48e4-8162-b20ae0465c41", "id": "24dfd20d-bc8d-48e4-8162-b20ae0465c41",
"idName": "ecoTemp",
"name": "eco temperature", "name": "eco temperature",
"type": "double", "type": "double",
"defaultValue": 0 "defaultValue": 0
}, },
{ {
"id": "a8536ddf-a6e4-41c2-89c1-e7102608f5f6", "id": "a8536ddf-a6e4-41c2-89c1-e7102608f5f6",
"idName": "maxSetpointTemp",
"name": "max setpoint", "name": "max setpoint",
"type": "double", "type": "double",
"defaultValue": 0 "defaultValue": 0
}, },
{ {
"id": "ceb0ad05-37ad-4b79-a4d9-540c34a7e3e4", "id": "ceb0ad05-37ad-4b79-a4d9-540c34a7e3e4",
"idName": "minSetpointTemp",
"name": "min setpoint", "name": "min setpoint",
"type": "double", "type": "double",
"defaultValue": 0 "defaultValue": 0
}, },
{ {
"id": "9880247b-cf9a-453c-b0c3-d910eba8a253", "id": "9880247b-cf9a-453c-b0c3-d910eba8a253",
"name": "error occured", "idName": "errorOccurred",
"name": "error occurred",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
}, },
{ {
"id": "a9e29f03-063e-4686-8aac-2f6d8f8a4937", "id": "a9e29f03-063e-4686-8aac-2f6d8f8a4937",
"idName": "initialized",
"name": "initialized", "name": "initialized",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
}, },
{ {
"id": "53b89f32-8894-4290-92a0-6a470c6b69ab", "id": "53b89f32-8894-4290-92a0-6a470c6b69ab",
"idName": "batteryLow",
"name": "battery low", "name": "battery low",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
}, },
{ {
"id": "aff38be8-7ea6-4fd8-b0fa-e987ab05c719", "id": "aff38be8-7ea6-4fd8-b0fa-e987ab05c719",
"idName": "linkStatusOK",
"name": "link status ok", "name": "link status ok",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
}, },
{ {
"id": "979df197-09a1-46f9-9217-9d323b1062bd", "id": "979df197-09a1-46f9-9217-9d323b1062bd",
"idName": "panelLocked",
"name": "panel locked", "name": "panel locked",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
}, },
{ {
"id": "1d6bd962-5c31-47ad-80a4-dda87bff98f5", "id": "1d6bd962-5c31-47ad-80a4-dda87bff98f5",
"idName": "gatewayKnown",
"name": "gateway known", "name": "gateway known",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
}, },
{ {
"id": "1b402ba6-a8ae-45b1-8acf-2b0a89f71889", "id": "1b402ba6-a8ae-45b1-8acf-2b0a89f71889",
"idName": "dtsActive",
"name": "dts active", "name": "dts active",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
}, },
{ {
"id": "639360f0-bb65-43e6-b227-50ae0ac39d6c", "id": "639360f0-bb65-43e6-b227-50ae0ac39d6c",
"idName": "deviceMode",
"name": "device mode", "name": "device mode",
"type": "int", "type": "int",
"defaultValue": -1 "defaultValue": -1
}, },
{ {
"id": "ff5194e3-5641-4ac2-92c7-48c431b4a2eb", "id": "ff5194e3-5641-4ac2-92c7-48c431b4a2eb",
"idName": "deviceModeString",
"name": "device mode string", "name": "device mode string",
"type": "QString" "type": "QString"
}, },
{ {
"id": "579aa8c6-8814-491b-9e7c-b98108c323d1", "id": "579aa8c6-8814-491b-9e7c-b98108c323d1",
"idName": "setpointTemp",
"name": "set point temp", "name": "set point temp",
"type": "double", "type": "double",
"defaultValue": 0 "defaultValue": 0
}, },
{ {
"id": "852e7708-db1d-42d1-96e4-19c13598262c", "id": "852e7708-db1d-42d1-96e4-19c13598262c",
"idName": "currentTemperature",
"name": "current temp", "name": "current temp",
"type": "double", "type": "double",
"defaultValue": 0 "defaultValue": 0
@ -203,6 +223,7 @@
}, },
{ {
"deviceClassId": "f80d9481-4827-45ee-a013-b97b22412d92", "deviceClassId": "f80d9481-4827-45ee-a013-b97b22412d92",
"idName": "radiatorThermostate",
"name": "Max! Radiator Thermostat", "name": "Max! Radiator Thermostat",
"createMethods": ["auto"], "createMethods": ["auto"],
"paramTypes": [ "paramTypes": [
@ -234,6 +255,7 @@
"actionTypes": [ "actionTypes": [
{ {
"id": "9c1968ba-39f9-493d-9fe2-848fa86bd2f0", "id": "9c1968ba-39f9-493d-9fe2-848fa86bd2f0",
"idName": "setSetpointTemperature",
"name": "set setpoint temperature", "name": "set setpoint temperature",
"paramTypes": [ "paramTypes": [
{ {
@ -245,14 +267,17 @@
}, },
{ {
"id": "162b4b3d-9923-4f2c-a755-b50c8a06a6f0", "id": "162b4b3d-9923-4f2c-a755-b50c8a06a6f0",
"idName": "setAutoMode",
"name": "set auto mode" "name": "set auto mode"
}, },
{ {
"id": "8e604437-9f5b-4c17-b5b0-e2db6007af5b", "id": "8e604437-9f5b-4c17-b5b0-e2db6007af5b",
"idName": "setManualMode",
"name": "set manual mode" "name": "set manual mode"
}, },
{ {
"id": "27a981e8-ec23-4ba8-921e-33b911a7dd89", "id": "27a981e8-ec23-4ba8-921e-33b911a7dd89",
"idName": "setEcoMode",
"name": "set eco mode" "name": "set eco mode"
} }
], ],
@ -342,54 +367,63 @@
}, },
{ {
"id": "576da571-9a65-478f-96bf-19256c8b9ece", "id": "576da571-9a65-478f-96bf-19256c8b9ece",
"idName": "offsetTemp",
"name": "offset temperature", "name": "offset temperature",
"type": "double", "type": "double",
"defaultValue": 0 "defaultValue": 0
}, },
{ {
"id": "81c6c74a-b0cd-4daa-9eb9-f1cd68f328af", "id": "81c6c74a-b0cd-4daa-9eb9-f1cd68f328af",
"idName": "windowOpenDuration",
"name": "window open duration", "name": "window open duration",
"type": "int", "type": "int",
"defaultValue": 0 "defaultValue": 0
}, },
{ {
"id": "7c41fa64-b1a1-48d2-9d03-67aa16cd83ad", "id": "7c41fa64-b1a1-48d2-9d03-67aa16cd83ad",
"idName": "boostValveValue",
"name": "boost valve value", "name": "boost valve value",
"type": "int", "type": "int",
"defaultValue": 0 "defaultValue": 0
}, },
{ {
"id": "e75c1398-9ad7-466c-b3b9-b03bbb686a30", "id": "e75c1398-9ad7-466c-b3b9-b03bbb686a30",
"idName": "boostDuration",
"name": "boost duration", "name": "boost duration",
"type": "int", "type": "int",
"defaultValue": 0 "defaultValue": 0
}, },
{ {
"id": "bd6f5947-d4b4-444b-81c8-77eec46957e4", "id": "bd6f5947-d4b4-444b-81c8-77eec46957e4",
"idName": "discalcWeekDay",
"name": "discalc weekday", "name": "discalc weekday",
"type": "QString", "type": "QString",
"defaultValue": "" "defaultValue": ""
}, },
{ {
"id": "e78235ee-affc-41e3-a463-9f0512b4a6c3", "id": "e78235ee-affc-41e3-a463-9f0512b4a6c3",
"idName": "discalcTime",
"name": "discalc time", "name": "discalc time",
"type": "QString", "type": "QString",
"defaultValue": "" "defaultValue": ""
}, },
{ {
"id": "e367fa3a-b30f-49bd-af3f-cff92360ad32", "id": "e367fa3a-b30f-49bd-af3f-cff92360ad32",
"idName": "valveMaximumSettings",
"name": "valve maximum setting", "name": "valve maximum setting",
"type": "double", "type": "double",
"defaultValue": 0 "defaultValue": 0
}, },
{ {
"id": "ffaff87b-b741-4db8-9875-3380af4f1885", "id": "ffaff87b-b741-4db8-9875-3380af4f1885",
"idName": "valveOffset",
"name": "valve offset %", "name": "valve offset %",
"type": "int", "type": "int",
"defaultValue": 0 "defaultValue": 0
}, },
{ {
"id": "72956000-0203-4c32-a6b6-3bb7e46c03ca", "id": "72956000-0203-4c32-a6b6-3bb7e46c03ca",
"idName": "valvePosition",
"name": "valve position %", "name": "valve position %",
"type": "int", "type": "int",
"defaultValue": 0 "defaultValue": 0

View File

@ -313,7 +313,7 @@ void MaxCube::decodeConfigMessage(QByteArray data)
//int roomId = dataRaw.mid(10,2).toInt(0,16); //int roomId = dataRaw.mid(10,2).toInt(0,16);
//int firmware = dataRaw.mid(12,2).toInt(0,16); //int firmware = dataRaw.mid(12,2).toInt(0,16);
device->setConfortTemp((double)dataRaw.mid(36,2).toInt(0,16) / 2.0); device->setComfortTemp((double)dataRaw.mid(36,2).toInt(0,16) / 2.0);
device->setEcoTemp((double)dataRaw.mid(38,2).toInt(0,16) / 2.0); device->setEcoTemp((double)dataRaw.mid(38,2).toInt(0,16) / 2.0);
device->setMaxSetPointTemp((double)dataRaw.mid(40,2).toInt(0,16) / 2.0); device->setMaxSetPointTemp((double)dataRaw.mid(40,2).toInt(0,16) / 2.0);
device->setMinSetPointTemp((double)dataRaw.mid(42,2).toInt(0,16) / 2.0); device->setMinSetPointTemp((double)dataRaw.mid(42,2).toInt(0,16) / 2.0);
@ -361,7 +361,7 @@ void MaxCube::decodeConfigMessage(QByteArray data)
if(device->rfAddress() == rfAddress){ if(device->rfAddress() == rfAddress){
//int roomId = dataRaw.mid(10,2).toInt(0,16); //int roomId = dataRaw.mid(10,2).toInt(0,16);
//int firmware = dataRaw.mid(12,2).toInt(0,16); //int firmware = dataRaw.mid(12,2).toInt(0,16);
device->setConfortTemp((double)dataRaw.mid(36,2).toInt(0,16) / 2.0); device->setComfortTemp((double)dataRaw.mid(36,2).toInt(0,16) / 2.0);
device->setEcoTemp((double)dataRaw.mid(38,2).toInt(0,16)/2.0); device->setEcoTemp((double)dataRaw.mid(38,2).toInt(0,16)/2.0);
device->setMaxSetPointTemp((double)dataRaw.mid(40,2).toInt(0,16)/2.0); device->setMaxSetPointTemp((double)dataRaw.mid(40,2).toInt(0,16)/2.0);
device->setMinSetPointTemp((double)dataRaw.mid(42,2).toInt(0,16)/2.0); device->setMinSetPointTemp((double)dataRaw.mid(42,2).toInt(0,16)/2.0);

View File

@ -23,14 +23,14 @@ RadiatorThermostat::RadiatorThermostat(QObject *parent) :
{ {
} }
double RadiatorThermostat::confortTemp() const double RadiatorThermostat::comfortTemp() const
{ {
return m_confortTemp; return m_comfortTemp;
} }
void RadiatorThermostat::setConfortTemp(const double &confortTemp) void RadiatorThermostat::setComfortTemp(const double &comfortTemp)
{ {
m_confortTemp = confortTemp; m_comfortTemp = comfortTemp;
} }
double RadiatorThermostat::ecoTemp() const double RadiatorThermostat::ecoTemp() const

View File

@ -30,8 +30,8 @@ class RadiatorThermostat : public MaxDevice
public: public:
explicit RadiatorThermostat(QObject *parent = 0); explicit RadiatorThermostat(QObject *parent = 0);
double confortTemp() const; double comfortTemp() const;
void setConfortTemp(const double &confortTemp); void setComfortTemp(const double &comfortTemp);
double ecoTemp() const; double ecoTemp() const;
void setEcoTemp(const double &ecoTemp); void setEcoTemp(const double &ecoTemp);
@ -108,7 +108,7 @@ public:
void setSetpointTemperatre(const double &setpointTemperature); void setSetpointTemperatre(const double &setpointTemperature);
private: private:
double m_confortTemp; double m_comfortTemp;
double m_ecoTemp; double m_ecoTemp;
double m_maxSetPointTemp; double m_maxSetPointTemp;
double m_minSetPointTemp; double m_minSetPointTemp;

View File

@ -23,14 +23,14 @@ WallThermostat::WallThermostat(QObject *parent) :
{ {
} }
double WallThermostat::confortTemp() const double WallThermostat::comfortTemp() const
{ {
return m_confortTemp; return m_comfortTemp;
} }
void WallThermostat::setConfortTemp(const double &confortTemp) void WallThermostat::setComfortTemp(const double &comfortTemp)
{ {
m_confortTemp = confortTemp; m_comfortTemp = comfortTemp;
} }
double WallThermostat::ecoTemp() const double WallThermostat::ecoTemp() const

View File

@ -28,8 +28,8 @@ class WallThermostat : public MaxDevice
public: public:
explicit WallThermostat(QObject *parent = 0); explicit WallThermostat(QObject *parent = 0);
double confortTemp() const; double comfortTemp() const;
void setConfortTemp(const double &confortTemp); void setComfortTemp(const double &comfortTemp);
double ecoTemp() const; double ecoTemp() const;
void setEcoTemp(const double &ecoTemp); void setEcoTemp(const double &ecoTemp);
@ -82,7 +82,7 @@ public:
void setCurrentTemperatre(const double &currentTemperature); void setCurrentTemperatre(const double &currentTemperature);
private: private:
double m_confortTemp; double m_comfortTemp;
double m_ecoTemp; double m_ecoTemp;
double m_maxSetPointTemp; double m_maxSetPointTemp;
double m_minSetPointTemp; double m_minSetPointTemp;

View File

@ -18,23 +18,10 @@
#include "deviceplugingenericelements.h" #include "deviceplugingenericelements.h"
#include "devicemanager.h" #include "devicemanager.h"
#include "plugininfo.h"
#include <QDebug> #include <QDebug>
DeviceClassId toggleButtonDeviceClassId = DeviceClassId("c0f511f9-70f5-499b-bd70-2c0e9ddd68c4");
ActionTypeId toggleButtonToggleActionTypeId = ActionTypeId("47bdc15a-b393-4dc2-801b-845420cdfda3");
StateTypeId toggleButtonStatusStateTypeId = StateTypeId("b5e90567-54aa-49bd-a78a-3c19fb38aaf5");
DeviceClassId buttonDeviceClassId = DeviceClassId("820b2f2d-0d92-48c8-8fd4-f94ce8fc4103");
ActionTypeId buttonPressActionTypeId = ActionTypeId("01f38af1-b2ab-4ec3-844e-ef52f0f229a9");
EventTypeId buttonPressedEventTypeId = EventTypeId("effdbc2d-e467-4b0b-80a9-9dda251bfa5c");
DeviceClassId onOffButtonDeviceClassId = DeviceClassId("430d188c-476d-4825-a9bd-86dfa3094b56");
ActionTypeId onOffButtonOnActionTypeId = ActionTypeId("892596d2-0863-4807-97da-469b9f7003f2");
ActionTypeId onOffButtonOffActionTypeId = ActionTypeId("a8d64050-0b58-4ccf-b052-77ce2b7368ad");
EventTypeId onOffButtonOnEventTypeId = EventTypeId("4eeba6a2-e4c7-4a2e-8360-2797d98114e6");
EventTypeId onOffButtonOffEventTypeId = EventTypeId("b636c5f3-2eb0-4682-96d4-88a4aa9d2c12");
DevicePluginGenericElements::DevicePluginGenericElements() DevicePluginGenericElements::DevicePluginGenericElements()
{ {
} }

View File

@ -8,6 +8,7 @@
"deviceClasses": [ "deviceClasses": [
{ {
"deviceClassId": "c0f511f9-70f5-499b-bd70-2c0e9ddd68c4", "deviceClassId": "c0f511f9-70f5-499b-bd70-2c0e9ddd68c4",
"idName": "toggleButton",
"name": "Toggle Button", "name": "Toggle Button",
"createMethods": ["user"], "createMethods": ["user"],
"paramTypes": [ "paramTypes": [
@ -19,6 +20,7 @@
"stateTypes": [ "stateTypes": [
{ {
"id": "b5e90567-54aa-49bd-a78a-3c19fb38aaf5", "id": "b5e90567-54aa-49bd-a78a-3c19fb38aaf5",
"idName": "toggleButtonStatus",
"name": "state", "name": "state",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
@ -27,12 +29,14 @@
"actionTypes": [ "actionTypes": [
{ {
"id": "47bdc15a-b393-4dc2-801b-845420cdfda3", "id": "47bdc15a-b393-4dc2-801b-845420cdfda3",
"idName": "toggleButtonToggle",
"name": "toggle" "name": "toggle"
} }
] ]
}, },
{ {
"deviceClassId": "820b2f2d-0d92-48c8-8fd4-f94ce8fc4103", "deviceClassId": "820b2f2d-0d92-48c8-8fd4-f94ce8fc4103",
"idName": "button",
"name": "Button", "name": "Button",
"createMethods": ["user"], "createMethods": ["user"],
"paramTypes": [ "paramTypes": [
@ -44,18 +48,21 @@
"actionTypes": [ "actionTypes": [
{ {
"id": "01f38af1-b2ab-4ec3-844e-ef52f0f229a9", "id": "01f38af1-b2ab-4ec3-844e-ef52f0f229a9",
"idName": "buttonPress",
"name": "press" "name": "press"
} }
], ],
"eventTypes": [ "eventTypes": [
{ {
"id": "effdbc2d-e467-4b0b-80a9-9dda251bfa5c", "id": "effdbc2d-e467-4b0b-80a9-9dda251bfa5c",
"idName": "buttonPressed",
"name": "button pressed" "name": "button pressed"
} }
] ]
}, },
{ {
"deviceClassId": "430d188c-476d-4825-a9bd-86dfa3094b56", "deviceClassId": "430d188c-476d-4825-a9bd-86dfa3094b56",
"idName": "onOffButton",
"name": "ON/OFF Button", "name": "ON/OFF Button",
"createMethods": ["user"], "createMethods": ["user"],
"paramTypes": [ "paramTypes": [
@ -67,20 +74,24 @@
"actionTypes": [ "actionTypes": [
{ {
"id": "892596d2-0863-4807-97da-469b9f7003f2", "id": "892596d2-0863-4807-97da-469b9f7003f2",
"idName": "onOffButtonOn",
"name": "press ON" "name": "press ON"
}, },
{ {
"id": "a8d64050-0b58-4ccf-b052-77ce2b7368ad", "id": "a8d64050-0b58-4ccf-b052-77ce2b7368ad",
"idName": "onOffButtonOff",
"name": "press OFF" "name": "press OFF"
} }
], ],
"eventTypes": [ "eventTypes": [
{ {
"id": "4eeba6a2-e4c7-4a2e-8360-2797d98114e6", "id": "4eeba6a2-e4c7-4a2e-8360-2797d98114e6",
"idName": "onOffButtonOn",
"name": "ON pressed" "name": "ON pressed"
}, },
{ {
"id": "b636c5f3-2eb0-4682-96d4-88a4aa9d2c12", "id": "b636c5f3-2eb0-4682-96d4-88a4aa9d2c12",
"idName": "onOffButtonOff",
"name": "OFF pressed" "name": "OFF pressed"
} }
] ]

View File

@ -159,13 +159,11 @@
#include "plugin/device.h" #include "plugin/device.h"
#include "devicemanager.h" #include "devicemanager.h"
#include "plugininfo.h"
#include <QDebug> #include <QDebug>
#include <QStringList> #include <QStringList>
DeviceClassId intertechnoRemote = DeviceClassId("ab73ad2f-6594-45a3-9063-8f72d365c5e5");
DeviceClassId intertechnoSwitch = DeviceClassId("324219e8-7c53-41b5-b314-c2900cd15252");
DevicePluginIntertechno::DevicePluginIntertechno() DevicePluginIntertechno::DevicePluginIntertechno()
{ {
} }
@ -313,7 +311,7 @@ void DevicePluginIntertechno::radioData(const QList<int> &rawData)
return; return;
} }
QList<Device*> deviceList = deviceManager()->findConfiguredDevices(intertechnoRemote); QList<Device*> deviceList = deviceManager()->findConfiguredDevices(intertechnoRemoteDeviceClassId);
if(deviceList.isEmpty()){ if(deviceList.isEmpty()){
return; return;
} }

View File

@ -8,6 +8,7 @@
"deviceClasses": [ "deviceClasses": [
{ {
"deviceClassId": "ab73ad2f-6594-45a3-9063-8f72d365c5e5", "deviceClassId": "ab73ad2f-6594-45a3-9063-8f72d365c5e5",
"idName": "intertechnoRemote",
"name": "Intertechno Remote", "name": "Intertechno Remote",
"createMethods": ["user"], "createMethods": ["user"],
"paramTypes": [ "paramTypes": [

View File

@ -20,43 +20,10 @@
#include "plugin/device.h" #include "plugin/device.h"
#include "devicemanager.h" #include "devicemanager.h"
#include "plugininfo.h"
#include <QDebug> #include <QDebug>
DeviceClassId lgSmartTvDeviceClassId = DeviceClassId("1d41b5a8-74ff-4a12-b365-c7bbe610848f");
StateTypeId tvReachableStateTypeId = StateTypeId("b056c36b-df87-4177-8d5d-1e7c1e8cdc7a");
StateTypeId tv3DModeStateTypeId = StateTypeId("8ad3d77f-d340-495d-8c2a-5569a80e9d36");
StateTypeId tvVolumeLevelStateTypeId = StateTypeId("07d39a6e-7eab-42d0-851d-9f3bcd3bbb57");
StateTypeId tvMuteStateTypeId = StateTypeId("a6ac9061-3de7-403a-a646-790ca5d73764");
StateTypeId tvChannelTypeStateTypeId = StateTypeId("84c86670-77c7-4fc6-9e23-abca066e76aa");
StateTypeId tvChannelNameStateTypeId = StateTypeId("265dc5f7-3f4d-4002-a6fe-2a53986bcf1d");
StateTypeId tvChannelNumberStateTypeId = StateTypeId("881629a3-4ce2-42ba-8ce6-10d90c383799");
StateTypeId tvProgramNameStateTypeId = StateTypeId("3f53e52e-1ad7-40e7-8080-76908e720cac");
StateTypeId tvInputSourceIndexStateTypeId = StateTypeId("e895017a-139f-410c-bfb2-4d008104e164");
StateTypeId tvInputSourceLabelNameStateTypeId = StateTypeId("58b734ec-2269-4c57-99e1-e1eeee401053");
ActionTypeId commandVolumeUpActionTypeId = ActionTypeId("ac5d7dcd-dfe8-4a94-9ab9-21b3f804b39e");
ActionTypeId commandVolumeDownActionTypeId = ActionTypeId("62b17bec-f461-4ffa-93d1-67a9430d55e1");
ActionTypeId commandMuteActionTypeId = ActionTypeId("1aa9d7f0-0f66-4b90-bb72-f6b7b2118221");
ActionTypeId commandUnmuteActionTypeId = ActionTypeId("b7e31999-ba67-443d-8e5c-ec104af987bd");
ActionTypeId commandChannelUpActionTypeId = ActionTypeId("acd1f6a0-2cfa-4665-9607-cf94245ec5a3");
ActionTypeId commandChannelDownActionTypeId = ActionTypeId("6ea66772-0e6d-40b1-978c-a01fb53871dd");
ActionTypeId commandPowerOffActionTypeId = ActionTypeId("cbe41134-ff11-4916-815b-3ac289c64090");
ActionTypeId commandArrowUpActionTypeId = ActionTypeId("57c483b4-4ddf-4470-828c-8d8767e7a923");
ActionTypeId commandArrowDownActionTypeId = ActionTypeId("614cf1af-5cf7-4bb2-885c-4414078d8899");
ActionTypeId commandArrowLeftActionTypeId = ActionTypeId("916394dd-7833-4875-8d7a-49d7d24ceeb2");
ActionTypeId commandArrowRightActionTypeId = ActionTypeId("01e3df1e-638b-4e14-ba85-660267766062");
ActionTypeId commandOkActionTypeId = ActionTypeId("257dfa59-0d38-4e18-a3fc-213809fdb12f");
ActionTypeId commandBackActionTypeId = ActionTypeId("ce4184b3-6b8e-4fc3-a4cb-7b8ec72f2ce9");
ActionTypeId commandHomeActionTypeId = ActionTypeId("33f941c1-f5fc-4449-b6e3-93eafca493e0");
ActionTypeId commandInputSourceActionTypeId = ActionTypeId("9a6e5111-95d3-49ac-8056-249e704b1509");
ActionTypeId commandExitActionTypeId = ActionTypeId("d76efdb8-056e-4b39-a839-2ef6d6001b00");
ActionTypeId commandInfoActionTypeId = ActionTypeId("9c1290d5-3135-4124-a576-fc7522cffdcf");
ActionTypeId commandMyAppsActionTypeId = ActionTypeId("47d65cac-fe75-4c36-9dee-9862c1c1130e");
ActionTypeId commandProgramListActionTypeId = ActionTypeId("9aa3a97e-505d-4906-9764-14b6dc4e31e8");
DevicePluginLgSmartTv::DevicePluginLgSmartTv() DevicePluginLgSmartTv::DevicePluginLgSmartTv()
{ {

View File

@ -8,6 +8,7 @@
"deviceClasses": [ "deviceClasses": [
{ {
"deviceClassId": "1d41b5a8-74ff-4a12-b365-c7bbe610848f", "deviceClassId": "1d41b5a8-74ff-4a12-b365-c7bbe610848f",
"idName": "lgSmartTv",
"name": "LG Smart Tv", "name": "LG Smart Tv",
"createMethods": ["discovery"], "createMethods": ["discovery"],
"paramTypes": [ "paramTypes": [
@ -47,57 +48,67 @@
"stateTypes": [ "stateTypes": [
{ {
"id": "b056c36b-df87-4177-8d5d-1e7c1e8cdc7a", "id": "b056c36b-df87-4177-8d5d-1e7c1e8cdc7a",
"idName": "tvReachable",
"name": "reachable", "name": "reachable",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
}, },
{ {
"id": "8ad3d77f-d340-495d-8c2a-5569a80e9d36", "id": "8ad3d77f-d340-495d-8c2a-5569a80e9d36",
"idName": "tv3DMode",
"name": "3D mode", "name": "3D mode",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
}, },
{ {
"id": "07d39a6e-7eab-42d0-851d-9f3bcd3bbb57", "id": "07d39a6e-7eab-42d0-851d-9f3bcd3bbb57",
"idName": "tvVolumeLevel",
"name": "volume level", "name": "volume level",
"type": "int", "type": "int",
"defaultValue": 0 "defaultValue": 0
}, },
{ {
"id": "a6ac9061-3de7-403a-a646-790ca5d73764", "id": "a6ac9061-3de7-403a-a646-790ca5d73764",
"idName": "tvMute",
"name": "mute", "name": "mute",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
}, },
{ {
"id": "84c86670-77c7-4fc6-9e23-abca066e76aa", "id": "84c86670-77c7-4fc6-9e23-abca066e76aa",
"idName": "tvChannelType",
"name": "tv channel type", "name": "tv channel type",
"type": "QString" "type": "QString"
}, },
{ {
"id": "265dc5f7-3f4d-4002-a6fe-2a53986bcf1d", "id": "265dc5f7-3f4d-4002-a6fe-2a53986bcf1d",
"idName": "tvChannelName",
"name": "channel name", "name": "channel name",
"type": "QString" "type": "QString"
}, },
{ {
"id": "881629a3-4ce2-42ba-8ce6-10d90c383799", "id": "881629a3-4ce2-42ba-8ce6-10d90c383799",
"idName": "tvChannelNumber",
"name": "channel number", "name": "channel number",
"type": "int", "type": "int",
"defaultValue": 0 "defaultValue": 0
}, },
{ {
"id": "3f53e52e-1ad7-40e7-8080-76908e720cac", "id": "3f53e52e-1ad7-40e7-8080-76908e720cac",
"idName": "tvProgramName",
"name": "program name", "name": "program name",
"type": "QString" "type": "QString"
}, },
{ {
"id": "e895017a-139f-410c-bfb2-4d008104e164", "id": "e895017a-139f-410c-bfb2-4d008104e164",
"idName": "tvInputSourceIndex",
"name": "input source index", "name": "input source index",
"type": "int", "type": "int",
"defaultValue": 0 "defaultValue": 0
}, },
{ {
"id": "58b734ec-2269-4c57-99e1-e1eeee401053", "id": "58b734ec-2269-4c57-99e1-e1eeee401053",
"idName": "tvInputSourceLabelName",
"name": "input source label", "name": "input source label",
"type": "QString" "type": "QString"
} }
@ -105,78 +116,97 @@
"actionTypes": [ "actionTypes": [
{ {
"id": "ac5d7dcd-dfe8-4a94-9ab9-21b3f804b39e", "id": "ac5d7dcd-dfe8-4a94-9ab9-21b3f804b39e",
"idName": "commandVolumeUp",
"name": "volume up" "name": "volume up"
}, },
{ {
"id": "62b17bec-f461-4ffa-93d1-67a9430d55e1", "id": "62b17bec-f461-4ffa-93d1-67a9430d55e1",
"idName": "commandVolumeDown",
"name": "volume down" "name": "volume down"
}, },
{ {
"id": "1aa9d7f0-0f66-4b90-bb72-f6b7b2118221", "id": "1aa9d7f0-0f66-4b90-bb72-f6b7b2118221",
"idName": "commandMute",
"name": "mute" "name": "mute"
}, },
{ {
"id": "b7e31999-ba67-443d-8e5c-ec104af987bd", "id": "b7e31999-ba67-443d-8e5c-ec104af987bd",
"idName": "commandUnmute",
"name": "unmute" "name": "unmute"
}, },
{ {
"id": "acd1f6a0-2cfa-4665-9607-cf94245ec5a3", "id": "acd1f6a0-2cfa-4665-9607-cf94245ec5a3",
"idName": "commandChannelUp",
"name": "channel up" "name": "channel up"
}, },
{ {
"id": "6ea66772-0e6d-40b1-978c-a01fb53871dd", "id": "6ea66772-0e6d-40b1-978c-a01fb53871dd",
"idName": "commandChannelDown",
"name": "channel down" "name": "channel down"
}, },
{ {
"id": "cbe41134-ff11-4916-815b-3ac289c64090", "id": "cbe41134-ff11-4916-815b-3ac289c64090",
"idName": "commandPowerOff",
"name": "power off" "name": "power off"
}, },
{ {
"id": "57c483b4-4ddf-4470-828c-8d8767e7a923", "id": "57c483b4-4ddf-4470-828c-8d8767e7a923",
"idName": "commandArrowUp",
"name": "arrow up" "name": "arrow up"
}, },
{ {
"id": "614cf1af-5cf7-4bb2-885c-4414078d8899", "id": "614cf1af-5cf7-4bb2-885c-4414078d8899",
"idName": "commandArrowDown",
"name": "arrow down" "name": "arrow down"
}, },
{ {
"id": "916394dd-7833-4875-8d7a-49d7d24ceeb2", "id": "916394dd-7833-4875-8d7a-49d7d24ceeb2",
"idName": "commandArrowLeft",
"name": "arrow left" "name": "arrow left"
}, },
{ {
"id": "01e3df1e-638b-4e14-ba85-660267766062", "id": "01e3df1e-638b-4e14-ba85-660267766062",
"idName": "commandArrowRight",
"name": "arrow right" "name": "arrow right"
}, },
{ {
"id": "257dfa59-0d38-4e18-a3fc-213809fdb12f", "id": "257dfa59-0d38-4e18-a3fc-213809fdb12f",
"idName": "commandOk",
"name": "OK" "name": "OK"
}, },
{ {
"id": "ce4184b3-6b8e-4fc3-a4cb-7b8ec72f2ce9", "id": "ce4184b3-6b8e-4fc3-a4cb-7b8ec72f2ce9",
"idName": "commandBack",
"name": "back" "name": "back"
}, },
{ {
"id": "33f941c1-f5fc-4449-b6e3-93eafca493e0", "id": "33f941c1-f5fc-4449-b6e3-93eafca493e0",
"idName": "commandHome",
"name": "home" "name": "home"
}, },
{ {
"id": "9a6e5111-95d3-49ac-8056-249e704b1509", "id": "9a6e5111-95d3-49ac-8056-249e704b1509",
"idName": "commandInputSource",
"name": "input source" "name": "input source"
}, },
{ {
"id": "d76efdb8-056e-4b39-a839-2ef6d6001b00", "id": "d76efdb8-056e-4b39-a839-2ef6d6001b00",
"idName": "commandExit",
"name": "exit" "name": "exit"
}, },
{ {
"id": "9c1290d5-3135-4124-a576-fc7522cffdcf", "id": "9c1290d5-3135-4124-a576-fc7522cffdcf",
"idName": "commandInfo",
"name": "info" "name": "info"
}, },
{ {
"id": "47d65cac-fe75-4c36-9dee-9862c1c1130e", "id": "47d65cac-fe75-4c36-9dee-9862c1c1130e",
"idName": "commandMyApps",
"name": "my apps" "name": "my apps"
}, },
{ {
"id": "9aa3a97e-505d-4906-9764-14b6dc4e31e8", "id": "9aa3a97e-505d-4906-9764-14b6dc4e31e8",
"idName": "commandProgramList",
"name": "program list" "name": "program list"
} }
] ]

View File

@ -223,18 +223,13 @@
#include "plugin/device.h" #include "plugin/device.h"
#include "devicemanager.h" #include "devicemanager.h"
#include "plugininfo.h"
#include <QDebug> #include <QDebug>
#include <QJsonDocument> #include <QJsonDocument>
#include <QVariantMap> #include <QVariantMap>
#include <QDateTime> #include <QDateTime>
DeviceClassId googleMailDeviceClassId = DeviceClassId("3869884a-1592-4b8f-84a7-994be18ff555");
DeviceClassId yahooMailDeviceClassId = DeviceClassId("59409e8f-0c83-414f-abd5-bbbf2758acba");
DeviceClassId customMailDeviceClassId = DeviceClassId("f4844c97-7ca6-4349-904e-ff9749a9fe74");
ActionTypeId sendMailActionTypeId = ActionTypeId("054613b0-3666-4dad-9252-e0ebca187edc");
DevicePluginMailNotification::DevicePluginMailNotification() DevicePluginMailNotification::DevicePluginMailNotification()
{ {
} }

View File

@ -8,6 +8,7 @@
"deviceClasses": [ "deviceClasses": [
{ {
"deviceClassId": "3869884a-1592-4b8f-84a7-994be18ff555", "deviceClassId": "3869884a-1592-4b8f-84a7-994be18ff555",
"idName": "googleMail",
"name": "Google Mail", "name": "Google Mail",
"createMethods": ["user"], "createMethods": ["user"],
"paramTypes": [ "paramTypes": [
@ -27,6 +28,7 @@
"actionTypes": [ "actionTypes": [
{ {
"id": "054613b0-3666-4dad-9252-e0ebca187edc", "id": "054613b0-3666-4dad-9252-e0ebca187edc",
"idName": "sendMail",
"name": "Send mail", "name": "Send mail",
"paramTypes": [ "paramTypes": [
{ {
@ -43,6 +45,7 @@
}, },
{ {
"deviceClassId": "59409e8f-0c83-414f-abd5-bbbf2758acba", "deviceClassId": "59409e8f-0c83-414f-abd5-bbbf2758acba",
"idName": "yahooMail",
"name": "Yahoo Mail", "name": "Yahoo Mail",
"createMethods": ["user"], "createMethods": ["user"],
"paramTypes": [ "paramTypes": [
@ -78,6 +81,7 @@
}, },
{ {
"deviceClassId": "f4844c97-7ca6-4349-904e-ff9749a9fe74", "deviceClassId": "f4844c97-7ca6-4349-904e-ff9749a9fe74",
"idName": "customMail",
"name": "Custom Mail", "name": "Custom Mail",
"createMethods": ["user"], "createMethods": ["user"],
"paramTypes": [ "paramTypes": [

View File

@ -21,25 +21,11 @@
#include "plugin/device.h" #include "plugin/device.h"
#include "devicemanager.h" #include "devicemanager.h"
#include "plugininfo.h"
#include <QDebug> #include <QDebug>
#include <QStringList> #include <QStringList>
DeviceClassId mockDeviceClassId = DeviceClassId("753f0d32-0468-4d08-82ed-1964aab03298");
DeviceClassId mockDeviceAutoClassId = DeviceClassId("ab4257b3-7548-47ee-9bd4-7dc3004fd197");
//DeviceClassId mockDeviceDiscoveryClassId = DeviceClassId("1bbaf751-36b7-4d3d-b05a-58dab2a3be8c");
//DeviceClassId mockDeviceAsyncSetupClassId = DeviceClassId("c08a8b27-8200-413d-b96b-4cff78b864d9");
//DeviceClassId mockDeviceBrokenClassId = DeviceClassId("ba5fb404-c9ce-4db4-8cd4-f48c61c24b13");
//DeviceClassId mockDeviceBrokenAsyncSetupClassId = DeviceClassId("bd5b78c5-53c9-4417-8eac-8ab2bce97bd0");
EventTypeId mockEvent1Id = EventTypeId("45bf3752-0fc6-46b9-89fd-ffd878b5b22b");
EventTypeId mockEvent2Id = EventTypeId("863d5920-b1cf-4eb9-88bd-8f7b8583b1cf");
StateTypeId mockIntStateId = StateTypeId("80baec19-54de-4948-ac46-31eabfaceb83");
StateTypeId mockBoolStateId = StateTypeId("9dd6a97c-dfd1-43dc-acbd-367932742310");
ActionTypeId mockActionIdWithParams = ActionTypeId("dea0f4e1-65e3-4981-8eaa-2701c53a9185");
ActionTypeId mockActionIdNoParams = ActionTypeId("defd3ed6-1a0d-400b-8879-a0202cf39935");
ActionTypeId mockActionIdAsync = ActionTypeId("fbae06d3-7666-483e-a39e-ec50fe89054e");
ActionTypeId mockActionIdFailing = ActionTypeId("df3cf33d-26d5-4577-9132-9823bd33fad0");
ActionTypeId mockActionIdAsyncFailing = ActionTypeId("bfe89a1d-3497-4121-8318-e77c37537219");
DevicePluginMock::DevicePluginMock() DevicePluginMock::DevicePluginMock()
{ {
@ -99,12 +85,12 @@ void DevicePluginMock::deviceRemoved(Device *device)
void DevicePluginMock::startMonitoringAutoDevices() void DevicePluginMock::startMonitoringAutoDevices()
{ {
foreach (Device *device, myDevices()) { foreach (Device *device, myDevices()) {
if (device->deviceClassId() == mockDeviceAutoClassId) { if (device->deviceClassId() == mockDeviceAutoDeviceClassId) {
return; // We already have a Auto Mock device... do nothing. return; // We already have a Auto Mock device... do nothing.
} }
} }
DeviceDescriptor mockDescriptor(mockDeviceAutoClassId, "Mock Device (Auto created)"); DeviceDescriptor mockDescriptor(mockDeviceAutoDeviceClassId, "Mock Device (Auto created)");
ParamList params; ParamList params;
qsrand(QDateTime::currentMSecsSinceEpoch()); qsrand(QDateTime::currentMSecsSinceEpoch());
@ -116,7 +102,7 @@ void DevicePluginMock::startMonitoringAutoDevices()
QList<DeviceDescriptor> deviceDescriptorList; QList<DeviceDescriptor> deviceDescriptorList;
deviceDescriptorList.append(mockDescriptor); deviceDescriptorList.append(mockDescriptor);
emit autoDevicesAppeared(mockDeviceAutoClassId, deviceDescriptorList); emit autoDevicesAppeared(mockDeviceAutoDeviceClassId, deviceDescriptorList);
} }
QList<ParamType> DevicePluginMock::configurationDescription() const QList<ParamType> DevicePluginMock::configurationDescription() const
@ -138,13 +124,13 @@ DeviceManager::DeviceError DevicePluginMock::executeAction(Device *device, const
return DeviceManager::DeviceErrorDeviceNotFound; return DeviceManager::DeviceErrorDeviceNotFound;
} }
if (action.actionTypeId() == mockActionIdAsync || action.actionTypeId() == mockActionIdAsyncFailing) { if (action.actionTypeId() == mockAsyncActionTypeId || action.actionTypeId() == mockAsyncFailingActionTypeId) {
m_asyncActions.append(qMakePair<Action, Device*>(action, device)); m_asyncActions.append(qMakePair<Action, Device*>(action, device));
QTimer::singleShot(1000, this, SLOT(emitActionExecuted())); QTimer::singleShot(1000, this, SLOT(emitActionExecuted()));
return DeviceManager::DeviceErrorAsync; return DeviceManager::DeviceErrorAsync;
} }
if (action.actionTypeId() == mockActionIdFailing) { if (action.actionTypeId() == mockFailingActionTypeId) {
return DeviceManager::DeviceErrorSetupFailed; return DeviceManager::DeviceErrorSetupFailed;
} }
@ -217,10 +203,10 @@ void DevicePluginMock::emitDeviceSetupFinished()
void DevicePluginMock::emitActionExecuted() void DevicePluginMock::emitActionExecuted()
{ {
QPair<Action, Device*> action = m_asyncActions.takeFirst(); QPair<Action, Device*> action = m_asyncActions.takeFirst();
if (action.first.actionTypeId() == mockActionIdAsync) { if (action.first.actionTypeId() == mockAsyncActionTypeId) {
m_daemons.value(action.second)->actionExecuted(action.first.actionTypeId()); m_daemons.value(action.second)->actionExecuted(action.first.actionTypeId());
emit actionExecutionFinished(action.first.id(), DeviceManager::DeviceErrorNoError); emit actionExecutionFinished(action.first.id(), DeviceManager::DeviceErrorNoError);
} else if (action.first.actionTypeId() == mockActionIdAsyncFailing) { } else if (action.first.actionTypeId() == mockAsyncFailingActionTypeId) {
emit actionExecutionFinished(action.first.id(), DeviceManager::DeviceErrorSetupFailed); emit actionExecutionFinished(action.first.id(), DeviceManager::DeviceErrorSetupFailed);
} }
} }

View File

@ -8,6 +8,7 @@
"deviceClasses": [ "deviceClasses": [
{ {
"deviceClassId": "753f0d32-0468-4d08-82ed-1964aab03298", "deviceClassId": "753f0d32-0468-4d08-82ed-1964aab03298",
"idName": "mock",
"name": "Mock Device", "name": "Mock Device",
"createMethods": ["user", "discovery"], "createMethods": ["user", "discovery"],
"discoveryParamTypes": [ "discoveryParamTypes": [
@ -84,20 +85,24 @@
}, },
{ {
"id": "fbae06d3-7666-483e-a39e-ec50fe89054e", "id": "fbae06d3-7666-483e-a39e-ec50fe89054e",
"idName": "mockAsync",
"name": "Mock Action 3 (async)" "name": "Mock Action 3 (async)"
}, },
{ {
"id": "df3cf33d-26d5-4577-9132-9823bd33fad0", "id": "df3cf33d-26d5-4577-9132-9823bd33fad0",
"idName": "mockFailing",
"name": "Mock Action 4 (broken)" "name": "Mock Action 4 (broken)"
}, },
{ {
"id": "bfe89a1d-3497-4121-8318-e77c37537219", "id": "bfe89a1d-3497-4121-8318-e77c37537219",
"idName": "mockAsyncFailing",
"name": "Mock Action 5 (async, broken)" "name": "Mock Action 5 (async, broken)"
} }
] ]
}, },
{ {
"deviceClassId": "ab4257b3-7548-47ee-9bd4-7dc3004fd197", "deviceClassId": "ab4257b3-7548-47ee-9bd4-7dc3004fd197",
"idName": "mockDeviceAuto",
"name": "Mock Device (Auto created)", "name": "Mock Device (Auto created)",
"createMethods": ["auto"], "createMethods": ["auto"],
"paramTypes": [ "paramTypes": [

View File

@ -272,29 +272,13 @@
#include "plugin/device.h" #include "plugin/device.h"
#include "devicemanager.h" #include "devicemanager.h"
#include "plugininfo.h"
#include <QDebug> #include <QDebug>
#include <QJsonDocument> #include <QJsonDocument>
#include <QVariantMap> #include <QVariantMap>
#include <QDateTime> #include <QDateTime>
DeviceClassId openweathermapDeviceClassId = DeviceClassId("985195aa-17ad-4530-88a4-cdd753d747d7");
ActionTypeId updateWeatherActionTypeId = ActionTypeId("cfbc6504-d86f-4856-8dfa-97b6fbb385e4");
StateTypeId updateTimeStateTypeId = StateTypeId("36b2f09b-7d77-4fbc-a68f-23d735dda0b1");
StateTypeId temperatureStateTypeId = StateTypeId("6013402f-b5b1-46b3-8490-f0c20d62fe61");
StateTypeId temperatureMinStateTypeId = StateTypeId("14ec2781-cb04-4bbf-b097-7d01ef982630");
StateTypeId temperatureMaxStateTypeId = StateTypeId("fefe5563-452f-4833-b5cf-49c3cc67c772");
StateTypeId humidityStateTypeId = StateTypeId("6f32ec73-3240-4630-ada9-1c10b8e98123");
StateTypeId pressureStateTypeId = StateTypeId("4a42eea9-00eb-440b-915e-dbe42180f83b");
StateTypeId windSpeedStateTypeId = StateTypeId("2bf63430-e9e2-4fbf-88e6-6f1b4770f287");
StateTypeId windDirectionStateTypeId = StateTypeId("589e2ea5-65b2-4afd-9b72-e3708a589a12");
StateTypeId cloudinessStateTypeId = StateTypeId("798553bc-45c7-42eb-9105-430bddb5d9b7");
StateTypeId weatherDescriptionStateTypeId = StateTypeId("f9539108-0e0e-4736-a306-6408f8e20a26");
StateTypeId sunriseStateTypeId = StateTypeId("af155e94-9492-44e1-8608-7d0ee8b5d50d");
StateTypeId sunsetStateTypeId = StateTypeId("a1dddc3d-549f-4f20-b78b-be850548f286");
DevicePluginOpenweathermap::DevicePluginOpenweathermap() DevicePluginOpenweathermap::DevicePluginOpenweathermap()
{ {

View File

@ -8,6 +8,7 @@
"deviceClasses": [ "deviceClasses": [
{ {
"deviceClassId": "985195aa-17ad-4530-88a4-cdd753d747d7", "deviceClassId": "985195aa-17ad-4530-88a4-cdd753d747d7",
"idName": "openweathermap",
"name": "Weather from OpenWeatherMap", "name": "Weather from OpenWeatherMap",
"createMethods": ["discovery"], "createMethods": ["discovery"],
"discoveryParamTypes": [ "discoveryParamTypes": [
@ -33,77 +34,90 @@
"actionTypes": [ "actionTypes": [
{ {
"id": "cfbc6504-d86f-4856-8dfa-97b6fbb385e4", "id": "cfbc6504-d86f-4856-8dfa-97b6fbb385e4",
"idName": "updateWeather",
"name": "update" "name": "update"
} }
], ],
"stateTypes": [ "stateTypes": [
{ {
"id": "36b2f09b-7d77-4fbc-a68f-23d735dda0b1", "id": "36b2f09b-7d77-4fbc-a68f-23d735dda0b1",
"idName": "updateTime",
"name": "last update [unixtime]", "name": "last update [unixtime]",
"type": "uint", "type": "uint",
"defaultValue": "0" "defaultValue": "0"
}, },
{ {
"id": "6013402f-b5b1-46b3-8490-f0c20d62fe61", "id": "6013402f-b5b1-46b3-8490-f0c20d62fe61",
"idName": "temperature",
"name": "temperature [Celsius]", "name": "temperature [Celsius]",
"type": "double", "type": "double",
"defaultValue": "0" "defaultValue": "0"
}, },
{ {
"id": "14ec2781-cb04-4bbf-b097-7d01ef982630", "id": "14ec2781-cb04-4bbf-b097-7d01ef982630",
"idName": "temperatureMin",
"name": "temperature minimum [Celsius]", "name": "temperature minimum [Celsius]",
"type": "double", "type": "double",
"defaultValue": "0" "defaultValue": "0"
}, },
{ {
"id": "fefe5563-452f-4833-b5cf-49c3cc67c772", "id": "fefe5563-452f-4833-b5cf-49c3cc67c772",
"idName": "temperatureMax",
"name": "temperature maximum [Celsius]", "name": "temperature maximum [Celsius]",
"type": "double", "type": "double",
"defaultValue": "0" "defaultValue": "0"
}, },
{ {
"id": "6f32ec73-3240-4630-ada9-1c10b8e98123", "id": "6f32ec73-3240-4630-ada9-1c10b8e98123",
"idName": "humidity",
"name": "humidity [%]", "name": "humidity [%]",
"type": "int", "type": "int",
"defaultValue": "-1" "defaultValue": "-1"
}, },
{ {
"id": "4a42eea9-00eb-440b-915e-dbe42180f83b", "id": "4a42eea9-00eb-440b-915e-dbe42180f83b",
"idName": "pressure",
"name": "pressure [hPa]", "name": "pressure [hPa]",
"type": "double", "type": "double",
"defaultValue": "0" "defaultValue": "0"
}, },
{ {
"id": "2bf63430-e9e2-4fbf-88e6-6f1b4770f287", "id": "2bf63430-e9e2-4fbf-88e6-6f1b4770f287",
"idName": "windSpeed",
"name": "wind speed [m/s]", "name": "wind speed [m/s]",
"type": "double", "type": "double",
"defaultValue": "0" "defaultValue": "0"
}, },
{ {
"id": "589e2ea5-65b2-4afd-9b72-e3708a589a12", "id": "589e2ea5-65b2-4afd-9b72-e3708a589a12",
"idName": "windDirection",
"name": "wind direction [degree]", "name": "wind direction [degree]",
"type": "int", "type": "int",
"defaultValue": "0" "defaultValue": "0"
}, },
{ {
"id": "798553bc-45c7-42eb-9105-430bddb5d9b7", "id": "798553bc-45c7-42eb-9105-430bddb5d9b7",
"idName": "cloudiness",
"name": "cloudiness [%]", "name": "cloudiness [%]",
"type": "int", "type": "int",
"defaultValue": "0" "defaultValue": "0"
}, },
{ {
"id": "f9539108-0e0e-4736-a306-6408f8e20a26", "id": "f9539108-0e0e-4736-a306-6408f8e20a26",
"idName": "weatherDescription",
"name": "weather description", "name": "weather description",
"type": "QString" "type": "QString"
}, },
{ {
"id": "af155e94-9492-44e1-8608-7d0ee8b5d50d", "id": "af155e94-9492-44e1-8608-7d0ee8b5d50d",
"idName": "sunset",
"name": "sunset [timestamp]", "name": "sunset [timestamp]",
"type": "uint", "type": "uint",
"defaultValue": "0" "defaultValue": "0"
}, },
{ {
"id": "a1dddc3d-549f-4f20-b78b-be850548f286", "id": "a1dddc3d-549f-4f20-b78b-be850548f286",
"idName": "sunrise",
"name": "sunrise [unixtime]", "name": "sunrise [unixtime]",
"type": "int", "type": "int",
"defaultValue": "0" "defaultValue": "0"

View File

@ -22,26 +22,12 @@
#include "devicemanager.h" #include "devicemanager.h"
#include "types/param.h" #include "types/param.h"
#include "huebridgeconnection.h" #include "huebridgeconnection.h"
#include "plugininfo.h"
#include <QDebug> #include <QDebug>
#include <QStringList> #include <QStringList>
#include <QColor> #include <QColor>
VendorId hueVendorId = VendorId("");
DeviceClassId hueDeviceClassId = DeviceClassId("d8f4c397-e05e-47c1-8917-8e72d4d0d47c");
StateTypeId hueColorStateTypeId = StateTypeId("d25423e7-b924-4b20-80b6-77eecc65d089");
ActionTypeId hueSetColorActionTypeId = ActionTypeId("29cc299a-818b-47b2-817f-c5a6361545e4");
StateTypeId huePowerStateTypeId = StateTypeId("6ac64eee-f356-4ae4-bc85-8c1244d12b02");
ActionTypeId hueSetPowerActionTypeId = ActionTypeId("7782d91e-d73a-4321-8828-da768e2f6827");
StateTypeId hueBrightnessStateTypeId = StateTypeId("411f489c-4bc9-42f7-b47d-b0581dc0c29e");
ActionTypeId hueSetBrightnessActionTypeId = ActionTypeId("3bc95552-cba0-4222-abd5-9b668132e442");
StateTypeId hueReachableStateTypeId = StateTypeId("15794d26-fde8-4a61-8f83-d7830534975f");
DevicePluginPhilipsHue::DevicePluginPhilipsHue(): DevicePluginPhilipsHue::DevicePluginPhilipsHue():
m_discovery(new Discovery(this)) m_discovery(new Discovery(this))
{ {

View File

@ -8,6 +8,7 @@
"deviceClasses": [ "deviceClasses": [
{ {
"deviceClassId": "d8f4c397-e05e-47c1-8917-8e72d4d0d47c", "deviceClassId": "d8f4c397-e05e-47c1-8917-8e72d4d0d47c",
"idName": "hue",
"name": "Hue", "name": "Hue",
"createMethods": ["discovery", "auto"], "createMethods": ["discovery", "auto"],
"setupMethod": "pushButton", "setupMethod": "pushButton",
@ -29,19 +30,36 @@
"stateTypes": [ "stateTypes": [
{ {
"id": "15794d26-fde8-4a61-8f83-d7830534975f", "id": "15794d26-fde8-4a61-8f83-d7830534975f",
"idName": "hueReachable",
"name": "reachable", "name": "reachable",
"type": "bool" "type": "bool"
}, },
{ {
"id": "d25423e7-b924-4b20-80b6-77eecc65d089", "id": "d25423e7-b924-4b20-80b6-77eecc65d089",
"idName": "hueColor",
"name": "color", "name": "color",
"type": "color", "type": "color",
"defaultValue": "black" "defaultValue": "black"
},
{
"id": "90aaffe5-6a76-47d2-a14a-550f60390245",
"idName": "huePower",
"name": "power",
"type": "bool",
"defaultValue": false
},
{
"id": "90e91f64-a208-468c-a5a2-7f47e08859e2",
"idName": "hueBrightness",
"name": "brightness",
"type": "int",
"defaultValue": 0
} }
], ],
"actionTypes": [ "actionTypes": [
{ {
"id": "29cc299a-818b-47b2-817f-c5a6361545e4", "id": "29cc299a-818b-47b2-817f-c5a6361545e4",
"idName": "hueSetColor",
"name": "Set color", "name": "Set color",
"paramTypes": [ "paramTypes": [
{ {
@ -52,6 +70,7 @@
}, },
{ {
"id": "7782d91e-d73a-4321-8828-da768e2f6827", "id": "7782d91e-d73a-4321-8828-da768e2f6827",
"idName": "hueSetPower",
"name": "Set power", "name": "Set power",
"paramTypes": [ "paramTypes": [
{ {
@ -62,6 +81,7 @@
}, },
{ {
"id": "3bc95552-cba0-4222-abd5-9b668132e442", "id": "3bc95552-cba0-4222-abd5-9b668132e442",
"idName": "hueSetBrightness",
"name": "Set brightness", "name": "Set brightness",
"paramTypes": [ "paramTypes": [
{ {

View File

@ -118,14 +118,12 @@
#include "plugin/device.h" #include "plugin/device.h"
#include "devicemanager.h" #include "devicemanager.h"
#include "plugininfo.h"
#include <QDebug> #include <QDebug>
#include <QStringList> #include <QStringList>
#include <QUdpSocket> #include <QUdpSocket>
DeviceClassId wolDeviceClassId = DeviceClassId("3c8f2447-dcd0-4882-8c09-99e579e4d24c");
ActionTypeId wolActionTypeId = ActionTypeId("fb9b9d87-218f-4f0d-9e16-39f8a105029a");
DevicePluginWakeOnLan::DevicePluginWakeOnLan() DevicePluginWakeOnLan::DevicePluginWakeOnLan()
{ {
} }

View File

@ -23,6 +23,7 @@
"actionTypes": [ "actionTypes": [
{ {
"id": "fb9b9d87-218f-4f0d-9e16-39f8a105029a", "id": "fb9b9d87-218f-4f0d-9e16-39f8a105029a",
"idName": "wol",
"name": "Wake up device" "name": "Wake up device"
} }
] ]

View File

@ -129,16 +129,10 @@
#include "plugin/device.h" #include "plugin/device.h"
#include "devicemanager.h" #include "devicemanager.h"
#include "plugininfo.h"
#include <QDebug> #include <QDebug>
DeviceClassId wemoSwitchDeviceClassId = DeviceClassId("69d97d3b-a8e6-42f3-afc0-ca8a53eb7cce");
StateTypeId powerStateTypeId = StateTypeId("7166c4f6-f68c-4188-8f7c-2205d72a5a6d");
StateTypeId reachableStateTypeId = StateTypeId("ec2f5b49-585c-4455-a233-b7aa4c608dbc");
ActionTypeId powerActionTypeId = ActionTypeId("269f25eb-d0b7-4144-b9ef-801f4ff3e90c");
DevicePluginWemo::DevicePluginWemo() DevicePluginWemo::DevicePluginWemo()
{ {
m_discovery = new WemoDiscovery(this); m_discovery = new WemoDiscovery(this);

View File

@ -8,6 +8,7 @@
"deviceClasses": [ "deviceClasses": [
{ {
"deviceClassId": "69d97d3b-a8e6-42f3-afc0-ca8a53eb7cce", "deviceClassId": "69d97d3b-a8e6-42f3-afc0-ca8a53eb7cce",
"idName": "wemoSwitch",
"name": "WeMo Switch", "name": "WeMo Switch",
"createMethods": ["discovery"], "createMethods": ["discovery"],
"paramTypes": [ "paramTypes": [
@ -55,12 +56,14 @@
"stateTypes": [ "stateTypes": [
{ {
"id": "7166c4f6-f68c-4188-8f7c-2205d72a5a6d", "id": "7166c4f6-f68c-4188-8f7c-2205d72a5a6d",
"idName": "power",
"name": "power", "name": "power",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
}, },
{ {
"id": "ec2f5b49-585c-4455-a233-b7aa4c608dbc", "id": "ec2f5b49-585c-4455-a233-b7aa4c608dbc",
"idName": "reachable",
"name": "reachable", "name": "reachable",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false
@ -69,6 +72,7 @@
"actionTypes": [ "actionTypes": [
{ {
"id": "269f25eb-d0b7-4144-b9ef-801f4ff3e90c", "id": "269f25eb-d0b7-4144-b9ef-801f4ff3e90c",
"idName": "power",
"name": "set power", "name": "set power",
"type": "bool", "type": "bool",
"defaultValue": true "defaultValue": true

View File

@ -20,13 +20,11 @@
#include "plugin/device.h" #include "plugin/device.h"
#include "devicemanager.h" #include "devicemanager.h"
#include "plugininfo.h"
#include <QDebug> #include <QDebug>
#include <QStringList> #include <QStringList>
DeviceClassId detectorId = DeviceClassId("bd216356-f1ec-4324-9785-6982d2174e17");
StateTypeId inRangeStateTypeId = StateTypeId("cb43e1b5-4f61-4538-bfa2-c33055c542cf");
DevicePluginWifiDetector::DevicePluginWifiDetector() DevicePluginWifiDetector::DevicePluginWifiDetector()
{ {
} }

View File

@ -19,6 +19,7 @@
"stateTypes": [ "stateTypes": [
{ {
"id": "cb43e1b5-4f61-4538-bfa2-c33055c542cf", "id": "cb43e1b5-4f61-4538-bfa2-c33055c542cf",
"idName": "inRange",
"name": "In Range", "name": "In Range",
"type": "bool", "type": "bool",
"defaultValue": false "defaultValue": false

86
plugins/generateplugininfo.py Executable file
View File

@ -0,0 +1,86 @@
#!/usr/bin/python
import json
import sys
inputFile = open(sys.argv[1], "r")
outputfile = open(sys.argv[2], "w")
def out(line):
outputfile.write("%s\n" % line)
try:
pluginMap = json.loads(inputFile.read())
except:
print("Error opening input file")
def extractVendors(pluginMap):
for vendor in pluginMap['vendors']:
try:
vendorIdName = pluginMap["idName"];
out("VendorId %s = VendorId(\"%s\");" % pluginMap["idName"], pluginMap["id"])
except:
pass
extractDeviceClasses(vendor)
def extractDeviceClasses(vendorMap):
for deviceClass in vendorMap["deviceClasses"]:
print("have deviceclass %s" % deviceClass["deviceClassId"])
try:
deviceClassIdName = deviceClass["idName"]
out("DeviceClassId %sDeviceClassId = DeviceClassId(\"%s\");" % (deviceClassIdName, deviceClass["deviceClassId"]))
except:
pass
extractActionTypes(deviceClass)
extractStateTypes(deviceClass)
extractEventTypes(deviceClass)
def extractStateTypes(deviceClassMap):
try:
for stateType in deviceClassMap["stateTypes"]:
try:
stateTypeIdName = stateType["idName"]
out("StateTypeId %sStateTypeId = StateTypeId(\"%s\");" % (stateTypeIdName, stateType["id"]))
except:
pass
except:
pass
def extractActionTypes(deviceClassMap):
try:
for actionType in deviceClassMap["actionTypes"]:
try:
actionTypeIdName = actionType["idName"]
out("ActionTypeId %sActionTypeId = ActionTypeId(\"%s\");" % (actionTypeIdName, actionType["id"]))
except:
pass
except:
pass
def extractEventTypes(deviceClassMap):
try:
for eventType in deviceClassMap["eventTypes"]:
try:
eventTypeIdName = eventType["idName"]
out("EventTypeId %sEventTypeId = EventTypeId(\"%s\");" % (eventTypeIdName, eventType["id"]))
except:
pass
except:
pass
# write header
out("#ifndef PLUGININFO_H")
out("#define PLUGININFO_H")
out("#include \"typeutils.h\"");
out("PluginId pluginId = PluginId(\"%s\");" % pluginMap['id'])
extractVendors(pluginMap)
out("#endif")

View File

@ -3,8 +3,18 @@ include(../guh.pri)
TEMPLATE = lib TEMPLATE = lib
CONFIG += plugin CONFIG += plugin
INCLUDEPATH += ../../../libguh INCLUDEPATH += $$top_srcdir/libguh
LIBS += -L../../../libguh -lguh LIBS += -L../../../libguh -lguh
infofile.output = plugininfo.h
infofile.commands = $$top_srcdir/plugins/generateplugininfo.py ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
infofile.depends = $$top_srcdir/plugins/generateplugininfo.py
infofile.CONFIG = no_link
JSONFILES = deviceplugin"$$TARGET".json
infofile.input = JSONFILES
QMAKE_EXTRA_COMPILERS += infofile
target.path = /usr/lib/guh/plugins/ target.path = /usr/lib/guh/plugins/
target.depends += if
INSTALLS += target INSTALLS += target