generate an include file with uuids from json
This commit is contained in:
parent
f75c7abde4
commit
73231419a9
@ -22,14 +22,11 @@
|
||||
#include "devicemanager.h"
|
||||
|
||||
#include "bobclient.h"
|
||||
#include "plugininfo.h"
|
||||
|
||||
#include <QDebug>
|
||||
#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()
|
||||
{
|
||||
m_bobClient = new BobClient(this);
|
||||
|
||||
@ -8,11 +8,13 @@
|
||||
"deviceClasses": [
|
||||
{
|
||||
"deviceClassId": "1647c61c-db14-461e-8060-8a3533d5d92f",
|
||||
"idName": "boblight",
|
||||
"name": "Boblight",
|
||||
"createMethods": ["auto"],
|
||||
"stateTypes": [
|
||||
{
|
||||
"id": "97ec80cd-43a9-40fa-93b7-d1580043d981",
|
||||
"idName": "color",
|
||||
"name": "color",
|
||||
"type": "QColor",
|
||||
"defaultValue": "#000000"
|
||||
@ -21,6 +23,7 @@
|
||||
"actionTypes": [
|
||||
{
|
||||
"id": "668e1aa3-fa13-49ce-8630-17a5c0a7c34b",
|
||||
"idName": "setColor",
|
||||
"name": "Set color",
|
||||
"paramTypes": [
|
||||
{
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
include (../../plugins.pri)
|
||||
|
||||
TARGET = $$qtLibraryTarget(guh_deviceplugincommandlauncher)
|
||||
|
||||
SOURCES += \
|
||||
|
||||
@ -20,15 +20,10 @@
|
||||
|
||||
#include "plugin/device.h"
|
||||
#include "devicemanager.h"
|
||||
#include "plugininfo.h"
|
||||
|
||||
#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()
|
||||
{
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
"deviceClasses": [
|
||||
{
|
||||
"deviceClassId": "0f39fe9e-51ea-4230-9646-2482c6234791",
|
||||
"idName": "application",
|
||||
"name": "Application launcher",
|
||||
"createMethods": ["user"],
|
||||
"paramTypes": [
|
||||
@ -23,6 +24,7 @@
|
||||
"stateTypes": [
|
||||
{
|
||||
"id": "28d7e933-ff05-4f4c-95a0-482689543de5",
|
||||
"idName": "running",
|
||||
"name": "running",
|
||||
"type": "bool",
|
||||
"defaultValue": false
|
||||
@ -31,16 +33,19 @@
|
||||
"actionTypes": [
|
||||
{
|
||||
"id": "cf52b41d-3108-423c-8907-ca5b4d97cac5",
|
||||
"idName": "execute",
|
||||
"name": "execute"
|
||||
},
|
||||
{
|
||||
"id": "d21b1fed-1dd9-4c5a-a64e-0c6ba94059be",
|
||||
"idName": "kill",
|
||||
"name": "kill"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"deviceClassId": "96044325-a6fb-47c9-9117-f29c3b327978",
|
||||
"idName": "script",
|
||||
"name": "Bashscript launcher",
|
||||
"createMethods": ["user"],
|
||||
"paramTypes": [
|
||||
|
||||
@ -60,9 +60,6 @@
|
||||
#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()
|
||||
{
|
||||
}
|
||||
|
||||
@ -21,23 +21,10 @@
|
||||
|
||||
#include "plugin/device.h"
|
||||
#include "devicemanager.h"
|
||||
#include "plugininfo.h"
|
||||
|
||||
#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()
|
||||
{
|
||||
m_timer = new QTimer(this);
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
"deviceClasses": [
|
||||
{
|
||||
"deviceClassId": "fbf665fb-9aca-423f-a5f2-924e50ebe6ca",
|
||||
"idName": "dateTime",
|
||||
"name": "Time",
|
||||
"createMethods": ["discovery"],
|
||||
"discoveryParamTypes": [
|
||||
@ -26,12 +27,14 @@
|
||||
"stateTypes": [
|
||||
{
|
||||
"id": "4f867051-bc3c-4b55-8493-10ab74c98a49",
|
||||
"idName": "minute",
|
||||
"name": "minute",
|
||||
"type": "uint",
|
||||
"defaultValue": "0"
|
||||
},
|
||||
{
|
||||
"id": "5b19d9de-a533-4b6f-b42c-bf8069e31adc",
|
||||
"idName": "hour",
|
||||
"name": "hour",
|
||||
"type": "uint",
|
||||
"defaultValue": "0"
|
||||
@ -39,53 +42,62 @@
|
||||
{
|
||||
"id": "eb5231ea-6a1b-4d7e-a95f-d49e7b25122e",
|
||||
"name": "day",
|
||||
"idName": "day",
|
||||
"type": "uint",
|
||||
"defaultValue": "1"
|
||||
},
|
||||
{
|
||||
"id": "fcd8ec96-4488-438a-8b30-58bfe2a7fae2",
|
||||
"name": "month",
|
||||
"idName": "month",
|
||||
"type": "uint",
|
||||
"defaultValue": "1"
|
||||
},
|
||||
{
|
||||
"id": "a37acc9c-5cfb-4687-adce-e56beb32586f",
|
||||
"idName": "monthName",
|
||||
"name": "month name",
|
||||
"type": "QString",
|
||||
"defaultValue": "-"
|
||||
},
|
||||
{
|
||||
"id": "4d0814f2-60a6-48c4-8b3b-031a099be8e3",
|
||||
"idName": "monthNameShort",
|
||||
"name": "month name short",
|
||||
"type": "QString",
|
||||
"defaultValue": "-"
|
||||
},
|
||||
{
|
||||
"id": "79d4ae9b-ea27-4346-8229-1d90f1ddfc9d",
|
||||
"idName": "year",
|
||||
"name": "year",
|
||||
"type": "uint",
|
||||
"defaultValue": "1970"
|
||||
},
|
||||
{
|
||||
"id": "452c0388-7fa1-414e-aeb2-8c7c385824b4",
|
||||
"idName": "weekday",
|
||||
"name": "weekday",
|
||||
"type": "int",
|
||||
"defaultValue": "1"
|
||||
},
|
||||
{
|
||||
"id": "f627d052-cee6-4727-b9c6-0e935d41e04a",
|
||||
"idName": "weekdayName",
|
||||
"name": "weekday name",
|
||||
"type": "QString",
|
||||
"defaultValue": "-"
|
||||
},
|
||||
{
|
||||
"id": "7e8e8e53-a83b-493d-850d-b0407f03463a",
|
||||
"idName": "weekdayNameShort",
|
||||
"name": "weekday name short",
|
||||
"type": "QString",
|
||||
"defaultValue": "-"
|
||||
},
|
||||
{
|
||||
"id": "4de5b57b-bb1a-4d66-9ce3-22bb280b075d",
|
||||
"idName": "weekend",
|
||||
"name": "weekend",
|
||||
"type": "bool",
|
||||
"defaultValue": "false"
|
||||
|
||||
@ -52,15 +52,11 @@
|
||||
|
||||
#include "devicepluginelro.h"
|
||||
#include "devicemanager.h"
|
||||
#include "plugininfo.h"
|
||||
|
||||
#include <QDebug>
|
||||
#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()
|
||||
{
|
||||
}
|
||||
@ -267,7 +263,7 @@ void DevicePluginElro::radioData(const QList<int> &rawData)
|
||||
}
|
||||
|
||||
Device *device = 0;
|
||||
QList<Device*> deviceList = deviceManager()->findConfiguredDevices(elroRemoteId);
|
||||
QList<Device*> deviceList = deviceManager()->findConfiguredDevices(elroRemoteDeviceClassId);
|
||||
foreach (Device *dev, deviceList) {
|
||||
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) &&
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{
|
||||
{
|
||||
"name": "Elro",
|
||||
"id": "2b267f81-d9ae-4f4f-89a0-7386b547cfd3",
|
||||
"vendors": [
|
||||
@ -8,6 +8,7 @@
|
||||
"deviceClasses": [
|
||||
{
|
||||
"deviceClassId": "d85c1ef4-197c-4053-8e40-707aa671d302",
|
||||
"idName": "elroRemote",
|
||||
"name": "Elro Remote",
|
||||
"createMethods": ["user"],
|
||||
"paramTypes": [
|
||||
|
||||
@ -140,8 +140,8 @@
|
||||
\li 852e7708-db1d-42d1-96e4-19c13598262c
|
||||
\li double
|
||||
\row
|
||||
\li confort temperature [Celsius]
|
||||
\li Describes the configured confort temperature. When the device goes into confort mode,
|
||||
\li comfort temperature [Celsius]
|
||||
\li Describes the configured comfort temperature. When the device goes into comfort mode,
|
||||
than this will be te setpoint temperature.
|
||||
\li 850380ee-a787-43e7-adb8-768a21a6e64d
|
||||
\li double
|
||||
@ -184,51 +184,10 @@
|
||||
#include "plugin/device.h"
|
||||
#include "devicemanager.h"
|
||||
#include "types/param.h"
|
||||
#include "plugininfo.h"
|
||||
|
||||
#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()
|
||||
{
|
||||
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());
|
||||
} else if (action.actionTypeId() == setAutoModeActionTypeId){
|
||||
cube->setDeviceAutoMode(rfAddress, roomId, action.id());
|
||||
} else if (action.actionTypeId() == setManuelModeActionTypeId){
|
||||
} else if (action.actionTypeId() == setManualModeActionTypeId){
|
||||
cube->setDeviceManuelMode(rfAddress, roomId, action.id());
|
||||
} else if (action.actionTypeId() == setEcoModeActionTypeId){
|
||||
cube->setDeviceEcoMode(rfAddress, roomId, action.id());
|
||||
@ -471,7 +430,7 @@ void DevicePluginEQ3::updateCubeConfig()
|
||||
Device *device;
|
||||
if (m_cubes.contains(cube)) {
|
||||
device = m_cubes.value(cube);
|
||||
device->setStateValue(portalEnabeldStateTypeId,cube->portalEnabeld());
|
||||
device->setStateValue(portalEnabledStateTypeId,cube->portalEnabeld());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -483,11 +442,11 @@ void DevicePluginEQ3::wallThermostatDataUpdated()
|
||||
foreach (WallThermostat *wallThermostat, cube->wallThermostatList()) {
|
||||
foreach (Device *device, deviceManager()->findConfiguredDevices(wallThermostateDeviceClassId)){
|
||||
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(maxSetpointTempStateTypeId, wallThermostat->maxSetPointTemp());
|
||||
device->setStateValue(minSetpointTempStateTypeId, wallThermostat->minSetPointTemp());
|
||||
device->setStateValue(errorOccuredStateTypeId, wallThermostat->errorOccured());
|
||||
device->setStateValue(errorOccurredStateTypeId, wallThermostat->errorOccured());
|
||||
device->setStateValue(initializedStateTypeId, wallThermostat->initialized());
|
||||
device->setStateValue(batteryLowStateTypeId, wallThermostat->batteryLow());
|
||||
device->setStateValue(linkStatusOKStateTypeId, wallThermostat->linkStatusOK());
|
||||
@ -512,11 +471,11 @@ void DevicePluginEQ3::radiatorThermostatDataUpdated()
|
||||
foreach (RadiatorThermostat *radiatorThermostat, cube->radiatorThermostatList()) {
|
||||
foreach (Device *device, deviceManager()->findConfiguredDevices(radiatorThermostateDeviceClassId)){
|
||||
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(maxSetpointTempStateTypeId, radiatorThermostat->maxSetPointTemp());
|
||||
device->setStateValue(minSetpointTempStateTypeId, radiatorThermostat->minSetPointTemp());
|
||||
device->setStateValue(errorOccuredStateTypeId, radiatorThermostat->errorOccured());
|
||||
device->setStateValue(errorOccurredStateTypeId, radiatorThermostat->errorOccured());
|
||||
device->setStateValue(initializedStateTypeId, radiatorThermostat->initialized());
|
||||
device->setStateValue(batteryLowStateTypeId, radiatorThermostat->batteryLow());
|
||||
device->setStateValue(linkStatusOKStateTypeId, radiatorThermostat->linkStatusOK());
|
||||
@ -528,7 +487,7 @@ void DevicePluginEQ3::radiatorThermostatDataUpdated()
|
||||
device->setStateValue(setpointTempStateTypeId, radiatorThermostat->setpointTemperature());
|
||||
device->setStateValue(offsetTempStateTypeId, radiatorThermostat->offsetTemp());
|
||||
device->setStateValue(windowOpenDurationStateTypeId, radiatorThermostat->windowOpenDuration());
|
||||
device->setStateValue(boostValueValueStateTypeId, radiatorThermostat->boostValveValue());
|
||||
device->setStateValue(boostValveValueStateTypeId, radiatorThermostat->boostValveValue());
|
||||
device->setStateValue(boostDurationStateTypeId, radiatorThermostat->boostDuration());
|
||||
device->setStateValue(discalcWeekDayStateTypeId, radiatorThermostat->discalcingWeekDay());
|
||||
device->setStateValue(discalcTimeStateTypeId, radiatorThermostat->discalcingTime().toString("HH:mm"));
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
"deviceClasses": [
|
||||
{
|
||||
"deviceClassId": "1e892268-8bd7-442c-a001-bd4e2e6b2949",
|
||||
"idName": "cube",
|
||||
"name": "Max! Cube LAN Gateway",
|
||||
"createMethods": ["discovery"],
|
||||
"paramTypes": [
|
||||
@ -31,12 +32,14 @@
|
||||
"stateTypes": [
|
||||
{
|
||||
"id": "d0a9a369-cf8c-47c4-a12e-f2d076bf12fd",
|
||||
"idName": "connection",
|
||||
"name": "connected",
|
||||
"type": "bool",
|
||||
"defaultValue": false
|
||||
},
|
||||
{
|
||||
"id": "2c2367da-c229-40ed-9d47-a6e73cd6dc3b",
|
||||
"idName": "portalEnabled",
|
||||
"name": "portal enabled",
|
||||
"type": "bool",
|
||||
"defaultValue": false
|
||||
@ -45,6 +48,7 @@
|
||||
},
|
||||
{
|
||||
"deviceClassId": "ffbfec5d-06e8-4082-b62b-92cc5c3e8c4e",
|
||||
"idName": "wallThermostate",
|
||||
"name": "Max! Wall Thermostat",
|
||||
"createMethods": ["auto"],
|
||||
"paramTypes": [
|
||||
@ -99,6 +103,7 @@
|
||||
},
|
||||
{
|
||||
"id": "184fb112-7a03-4560-8634-0257c969c26e",
|
||||
"idName": "displayCurrentTemp",
|
||||
"name": "display current temperature",
|
||||
"paramTypes": [
|
||||
{
|
||||
@ -112,89 +117,104 @@
|
||||
"stateTypes": [
|
||||
{
|
||||
"id": "850380ee-a787-43e7-adb8-768a21a6e64d",
|
||||
"idName": "comfortTemp",
|
||||
"name": "comfort temperature",
|
||||
"type": "double",
|
||||
"defaultValue": 0
|
||||
},
|
||||
{
|
||||
"id": "24dfd20d-bc8d-48e4-8162-b20ae0465c41",
|
||||
"idName": "ecoTemp",
|
||||
"name": "eco temperature",
|
||||
"type": "double",
|
||||
"defaultValue": 0
|
||||
},
|
||||
{
|
||||
"id": "a8536ddf-a6e4-41c2-89c1-e7102608f5f6",
|
||||
"idName": "maxSetpointTemp",
|
||||
"name": "max setpoint",
|
||||
"type": "double",
|
||||
"defaultValue": 0
|
||||
},
|
||||
{
|
||||
"id": "ceb0ad05-37ad-4b79-a4d9-540c34a7e3e4",
|
||||
"idName": "minSetpointTemp",
|
||||
"name": "min setpoint",
|
||||
"type": "double",
|
||||
"defaultValue": 0
|
||||
},
|
||||
{
|
||||
"id": "9880247b-cf9a-453c-b0c3-d910eba8a253",
|
||||
"name": "error occured",
|
||||
"idName": "errorOccurred",
|
||||
"name": "error occurred",
|
||||
"type": "bool",
|
||||
"defaultValue": false
|
||||
},
|
||||
{
|
||||
"id": "a9e29f03-063e-4686-8aac-2f6d8f8a4937",
|
||||
"idName": "initialized",
|
||||
"name": "initialized",
|
||||
"type": "bool",
|
||||
"defaultValue": false
|
||||
},
|
||||
{
|
||||
"id": "53b89f32-8894-4290-92a0-6a470c6b69ab",
|
||||
"idName": "batteryLow",
|
||||
"name": "battery low",
|
||||
"type": "bool",
|
||||
"defaultValue": false
|
||||
},
|
||||
{
|
||||
"id": "aff38be8-7ea6-4fd8-b0fa-e987ab05c719",
|
||||
"idName": "linkStatusOK",
|
||||
"name": "link status ok",
|
||||
"type": "bool",
|
||||
"defaultValue": false
|
||||
},
|
||||
{
|
||||
"id": "979df197-09a1-46f9-9217-9d323b1062bd",
|
||||
"idName": "panelLocked",
|
||||
"name": "panel locked",
|
||||
"type": "bool",
|
||||
"defaultValue": false
|
||||
},
|
||||
{
|
||||
"id": "1d6bd962-5c31-47ad-80a4-dda87bff98f5",
|
||||
"idName": "gatewayKnown",
|
||||
"name": "gateway known",
|
||||
"type": "bool",
|
||||
"defaultValue": false
|
||||
},
|
||||
{
|
||||
"id": "1b402ba6-a8ae-45b1-8acf-2b0a89f71889",
|
||||
"idName": "dtsActive",
|
||||
"name": "dts active",
|
||||
"type": "bool",
|
||||
"defaultValue": false
|
||||
},
|
||||
{
|
||||
"id": "639360f0-bb65-43e6-b227-50ae0ac39d6c",
|
||||
"idName": "deviceMode",
|
||||
"name": "device mode",
|
||||
"type": "int",
|
||||
"defaultValue": -1
|
||||
},
|
||||
{
|
||||
"id": "ff5194e3-5641-4ac2-92c7-48c431b4a2eb",
|
||||
"idName": "deviceModeString",
|
||||
"name": "device mode string",
|
||||
"type": "QString"
|
||||
},
|
||||
{
|
||||
"id": "579aa8c6-8814-491b-9e7c-b98108c323d1",
|
||||
"idName": "setpointTemp",
|
||||
"name": "set point temp",
|
||||
"type": "double",
|
||||
"defaultValue": 0
|
||||
},
|
||||
{
|
||||
"id": "852e7708-db1d-42d1-96e4-19c13598262c",
|
||||
"idName": "currentTemperature",
|
||||
"name": "current temp",
|
||||
"type": "double",
|
||||
"defaultValue": 0
|
||||
@ -203,6 +223,7 @@
|
||||
},
|
||||
{
|
||||
"deviceClassId": "f80d9481-4827-45ee-a013-b97b22412d92",
|
||||
"idName": "radiatorThermostate",
|
||||
"name": "Max! Radiator Thermostat",
|
||||
"createMethods": ["auto"],
|
||||
"paramTypes": [
|
||||
@ -234,6 +255,7 @@
|
||||
"actionTypes": [
|
||||
{
|
||||
"id": "9c1968ba-39f9-493d-9fe2-848fa86bd2f0",
|
||||
"idName": "setSetpointTemperature",
|
||||
"name": "set setpoint temperature",
|
||||
"paramTypes": [
|
||||
{
|
||||
@ -245,14 +267,17 @@
|
||||
},
|
||||
{
|
||||
"id": "162b4b3d-9923-4f2c-a755-b50c8a06a6f0",
|
||||
"idName": "setAutoMode",
|
||||
"name": "set auto mode"
|
||||
},
|
||||
{
|
||||
"id": "8e604437-9f5b-4c17-b5b0-e2db6007af5b",
|
||||
"idName": "setManualMode",
|
||||
"name": "set manual mode"
|
||||
},
|
||||
{
|
||||
"id": "27a981e8-ec23-4ba8-921e-33b911a7dd89",
|
||||
"idName": "setEcoMode",
|
||||
"name": "set eco mode"
|
||||
}
|
||||
],
|
||||
@ -342,54 +367,63 @@
|
||||
},
|
||||
{
|
||||
"id": "576da571-9a65-478f-96bf-19256c8b9ece",
|
||||
"idName": "offsetTemp",
|
||||
"name": "offset temperature",
|
||||
"type": "double",
|
||||
"defaultValue": 0
|
||||
},
|
||||
{
|
||||
"id": "81c6c74a-b0cd-4daa-9eb9-f1cd68f328af",
|
||||
"idName": "windowOpenDuration",
|
||||
"name": "window open duration",
|
||||
"type": "int",
|
||||
"defaultValue": 0
|
||||
},
|
||||
{
|
||||
"id": "7c41fa64-b1a1-48d2-9d03-67aa16cd83ad",
|
||||
"idName": "boostValveValue",
|
||||
"name": "boost valve value",
|
||||
"type": "int",
|
||||
"defaultValue": 0
|
||||
},
|
||||
{
|
||||
"id": "e75c1398-9ad7-466c-b3b9-b03bbb686a30",
|
||||
"idName": "boostDuration",
|
||||
"name": "boost duration",
|
||||
"type": "int",
|
||||
"defaultValue": 0
|
||||
},
|
||||
{
|
||||
"id": "bd6f5947-d4b4-444b-81c8-77eec46957e4",
|
||||
"idName": "discalcWeekDay",
|
||||
"name": "discalc weekday",
|
||||
"type": "QString",
|
||||
"defaultValue": ""
|
||||
},
|
||||
{
|
||||
"id": "e78235ee-affc-41e3-a463-9f0512b4a6c3",
|
||||
"idName": "discalcTime",
|
||||
"name": "discalc time",
|
||||
"type": "QString",
|
||||
"defaultValue": ""
|
||||
},
|
||||
{
|
||||
"id": "e367fa3a-b30f-49bd-af3f-cff92360ad32",
|
||||
"idName": "valveMaximumSettings",
|
||||
"name": "valve maximum setting",
|
||||
"type": "double",
|
||||
"defaultValue": 0
|
||||
},
|
||||
{
|
||||
"id": "ffaff87b-b741-4db8-9875-3380af4f1885",
|
||||
"idName": "valveOffset",
|
||||
"name": "valve offset %",
|
||||
"type": "int",
|
||||
"defaultValue": 0
|
||||
},
|
||||
{
|
||||
"id": "72956000-0203-4c32-a6b6-3bb7e46c03ca",
|
||||
"idName": "valvePosition",
|
||||
"name": "valve position %",
|
||||
"type": "int",
|
||||
"defaultValue": 0
|
||||
|
||||
@ -313,7 +313,7 @@ void MaxCube::decodeConfigMessage(QByteArray data)
|
||||
|
||||
//int roomId = dataRaw.mid(10,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->setMaxSetPointTemp((double)dataRaw.mid(40,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){
|
||||
//int roomId = dataRaw.mid(10,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->setMaxSetPointTemp((double)dataRaw.mid(40,2).toInt(0,16)/2.0);
|
||||
device->setMinSetPointTemp((double)dataRaw.mid(42,2).toInt(0,16)/2.0);
|
||||
|
||||
@ -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
|
||||
|
||||
@ -30,8 +30,8 @@ class RadiatorThermostat : public MaxDevice
|
||||
public:
|
||||
explicit RadiatorThermostat(QObject *parent = 0);
|
||||
|
||||
double confortTemp() const;
|
||||
void setConfortTemp(const double &confortTemp);
|
||||
double comfortTemp() const;
|
||||
void setComfortTemp(const double &comfortTemp);
|
||||
|
||||
double ecoTemp() const;
|
||||
void setEcoTemp(const double &ecoTemp);
|
||||
@ -108,7 +108,7 @@ public:
|
||||
void setSetpointTemperatre(const double &setpointTemperature);
|
||||
|
||||
private:
|
||||
double m_confortTemp;
|
||||
double m_comfortTemp;
|
||||
double m_ecoTemp;
|
||||
double m_maxSetPointTemp;
|
||||
double m_minSetPointTemp;
|
||||
|
||||
@ -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
|
||||
|
||||
@ -28,8 +28,8 @@ class WallThermostat : public MaxDevice
|
||||
public:
|
||||
explicit WallThermostat(QObject *parent = 0);
|
||||
|
||||
double confortTemp() const;
|
||||
void setConfortTemp(const double &confortTemp);
|
||||
double comfortTemp() const;
|
||||
void setComfortTemp(const double &comfortTemp);
|
||||
|
||||
double ecoTemp() const;
|
||||
void setEcoTemp(const double &ecoTemp);
|
||||
@ -82,7 +82,7 @@ public:
|
||||
void setCurrentTemperatre(const double ¤tTemperature);
|
||||
|
||||
private:
|
||||
double m_confortTemp;
|
||||
double m_comfortTemp;
|
||||
double m_ecoTemp;
|
||||
double m_maxSetPointTemp;
|
||||
double m_minSetPointTemp;
|
||||
|
||||
@ -18,23 +18,10 @@
|
||||
|
||||
#include "deviceplugingenericelements.h"
|
||||
#include "devicemanager.h"
|
||||
#include "plugininfo.h"
|
||||
|
||||
#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()
|
||||
{
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
"deviceClasses": [
|
||||
{
|
||||
"deviceClassId": "c0f511f9-70f5-499b-bd70-2c0e9ddd68c4",
|
||||
"idName": "toggleButton",
|
||||
"name": "Toggle Button",
|
||||
"createMethods": ["user"],
|
||||
"paramTypes": [
|
||||
@ -19,6 +20,7 @@
|
||||
"stateTypes": [
|
||||
{
|
||||
"id": "b5e90567-54aa-49bd-a78a-3c19fb38aaf5",
|
||||
"idName": "toggleButtonStatus",
|
||||
"name": "state",
|
||||
"type": "bool",
|
||||
"defaultValue": false
|
||||
@ -27,12 +29,14 @@
|
||||
"actionTypes": [
|
||||
{
|
||||
"id": "47bdc15a-b393-4dc2-801b-845420cdfda3",
|
||||
"idName": "toggleButtonToggle",
|
||||
"name": "toggle"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"deviceClassId": "820b2f2d-0d92-48c8-8fd4-f94ce8fc4103",
|
||||
"idName": "button",
|
||||
"name": "Button",
|
||||
"createMethods": ["user"],
|
||||
"paramTypes": [
|
||||
@ -44,18 +48,21 @@
|
||||
"actionTypes": [
|
||||
{
|
||||
"id": "01f38af1-b2ab-4ec3-844e-ef52f0f229a9",
|
||||
"idName": "buttonPress",
|
||||
"name": "press"
|
||||
}
|
||||
],
|
||||
"eventTypes": [
|
||||
{
|
||||
"id": "effdbc2d-e467-4b0b-80a9-9dda251bfa5c",
|
||||
"idName": "buttonPressed",
|
||||
"name": "button pressed"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"deviceClassId": "430d188c-476d-4825-a9bd-86dfa3094b56",
|
||||
"idName": "onOffButton",
|
||||
"name": "ON/OFF Button",
|
||||
"createMethods": ["user"],
|
||||
"paramTypes": [
|
||||
@ -67,20 +74,24 @@
|
||||
"actionTypes": [
|
||||
{
|
||||
"id": "892596d2-0863-4807-97da-469b9f7003f2",
|
||||
"idName": "onOffButtonOn",
|
||||
"name": "press ON"
|
||||
},
|
||||
{
|
||||
"id": "a8d64050-0b58-4ccf-b052-77ce2b7368ad",
|
||||
"idName": "onOffButtonOff",
|
||||
"name": "press OFF"
|
||||
}
|
||||
],
|
||||
"eventTypes": [
|
||||
{
|
||||
"id": "4eeba6a2-e4c7-4a2e-8360-2797d98114e6",
|
||||
"idName": "onOffButtonOn",
|
||||
"name": "ON pressed"
|
||||
},
|
||||
{
|
||||
"id": "b636c5f3-2eb0-4682-96d4-88a4aa9d2c12",
|
||||
"idName": "onOffButtonOff",
|
||||
"name": "OFF pressed"
|
||||
}
|
||||
]
|
||||
|
||||
@ -159,13 +159,11 @@
|
||||
|
||||
#include "plugin/device.h"
|
||||
#include "devicemanager.h"
|
||||
#include "plugininfo.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QStringList>
|
||||
|
||||
DeviceClassId intertechnoRemote = DeviceClassId("ab73ad2f-6594-45a3-9063-8f72d365c5e5");
|
||||
DeviceClassId intertechnoSwitch = DeviceClassId("324219e8-7c53-41b5-b314-c2900cd15252");
|
||||
|
||||
DevicePluginIntertechno::DevicePluginIntertechno()
|
||||
{
|
||||
}
|
||||
@ -313,7 +311,7 @@ void DevicePluginIntertechno::radioData(const QList<int> &rawData)
|
||||
return;
|
||||
}
|
||||
|
||||
QList<Device*> deviceList = deviceManager()->findConfiguredDevices(intertechnoRemote);
|
||||
QList<Device*> deviceList = deviceManager()->findConfiguredDevices(intertechnoRemoteDeviceClassId);
|
||||
if(deviceList.isEmpty()){
|
||||
return;
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
"deviceClasses": [
|
||||
{
|
||||
"deviceClassId": "ab73ad2f-6594-45a3-9063-8f72d365c5e5",
|
||||
"idName": "intertechnoRemote",
|
||||
"name": "Intertechno Remote",
|
||||
"createMethods": ["user"],
|
||||
"paramTypes": [
|
||||
|
||||
@ -20,43 +20,10 @@
|
||||
|
||||
#include "plugin/device.h"
|
||||
#include "devicemanager.h"
|
||||
#include "plugininfo.h"
|
||||
|
||||
#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()
|
||||
{
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
"deviceClasses": [
|
||||
{
|
||||
"deviceClassId": "1d41b5a8-74ff-4a12-b365-c7bbe610848f",
|
||||
"idName": "lgSmartTv",
|
||||
"name": "LG Smart Tv",
|
||||
"createMethods": ["discovery"],
|
||||
"paramTypes": [
|
||||
@ -47,57 +48,67 @@
|
||||
"stateTypes": [
|
||||
{
|
||||
"id": "b056c36b-df87-4177-8d5d-1e7c1e8cdc7a",
|
||||
"idName": "tvReachable",
|
||||
"name": "reachable",
|
||||
"type": "bool",
|
||||
"defaultValue": false
|
||||
},
|
||||
{
|
||||
"id": "8ad3d77f-d340-495d-8c2a-5569a80e9d36",
|
||||
"idName": "tv3DMode",
|
||||
"name": "3D mode",
|
||||
"type": "bool",
|
||||
"defaultValue": false
|
||||
},
|
||||
{
|
||||
"id": "07d39a6e-7eab-42d0-851d-9f3bcd3bbb57",
|
||||
"idName": "tvVolumeLevel",
|
||||
"name": "volume level",
|
||||
"type": "int",
|
||||
"defaultValue": 0
|
||||
},
|
||||
{
|
||||
"id": "a6ac9061-3de7-403a-a646-790ca5d73764",
|
||||
"idName": "tvMute",
|
||||
"name": "mute",
|
||||
"type": "bool",
|
||||
"defaultValue": false
|
||||
},
|
||||
{
|
||||
"id": "84c86670-77c7-4fc6-9e23-abca066e76aa",
|
||||
"idName": "tvChannelType",
|
||||
"name": "tv channel type",
|
||||
"type": "QString"
|
||||
},
|
||||
{
|
||||
"id": "265dc5f7-3f4d-4002-a6fe-2a53986bcf1d",
|
||||
"idName": "tvChannelName",
|
||||
"name": "channel name",
|
||||
"type": "QString"
|
||||
},
|
||||
{
|
||||
"id": "881629a3-4ce2-42ba-8ce6-10d90c383799",
|
||||
"idName": "tvChannelNumber",
|
||||
"name": "channel number",
|
||||
"type": "int",
|
||||
"defaultValue": 0
|
||||
},
|
||||
{
|
||||
"id": "3f53e52e-1ad7-40e7-8080-76908e720cac",
|
||||
"idName": "tvProgramName",
|
||||
"name": "program name",
|
||||
"type": "QString"
|
||||
},
|
||||
{
|
||||
"id": "e895017a-139f-410c-bfb2-4d008104e164",
|
||||
"idName": "tvInputSourceIndex",
|
||||
"name": "input source index",
|
||||
"type": "int",
|
||||
"defaultValue": 0
|
||||
},
|
||||
{
|
||||
"id": "58b734ec-2269-4c57-99e1-e1eeee401053",
|
||||
"idName": "tvInputSourceLabelName",
|
||||
"name": "input source label",
|
||||
"type": "QString"
|
||||
}
|
||||
@ -105,78 +116,97 @@
|
||||
"actionTypes": [
|
||||
{
|
||||
"id": "ac5d7dcd-dfe8-4a94-9ab9-21b3f804b39e",
|
||||
"idName": "commandVolumeUp",
|
||||
"name": "volume up"
|
||||
},
|
||||
{
|
||||
"id": "62b17bec-f461-4ffa-93d1-67a9430d55e1",
|
||||
"idName": "commandVolumeDown",
|
||||
"name": "volume down"
|
||||
},
|
||||
{
|
||||
"id": "1aa9d7f0-0f66-4b90-bb72-f6b7b2118221",
|
||||
"idName": "commandMute",
|
||||
"name": "mute"
|
||||
},
|
||||
{
|
||||
"id": "b7e31999-ba67-443d-8e5c-ec104af987bd",
|
||||
"idName": "commandUnmute",
|
||||
"name": "unmute"
|
||||
},
|
||||
{
|
||||
"id": "acd1f6a0-2cfa-4665-9607-cf94245ec5a3",
|
||||
"idName": "commandChannelUp",
|
||||
"name": "channel up"
|
||||
},
|
||||
{
|
||||
"id": "6ea66772-0e6d-40b1-978c-a01fb53871dd",
|
||||
"idName": "commandChannelDown",
|
||||
"name": "channel down"
|
||||
},
|
||||
{
|
||||
"id": "cbe41134-ff11-4916-815b-3ac289c64090",
|
||||
"idName": "commandPowerOff",
|
||||
"name": "power off"
|
||||
},
|
||||
{
|
||||
"id": "57c483b4-4ddf-4470-828c-8d8767e7a923",
|
||||
"idName": "commandArrowUp",
|
||||
"name": "arrow up"
|
||||
},
|
||||
{
|
||||
"id": "614cf1af-5cf7-4bb2-885c-4414078d8899",
|
||||
"idName": "commandArrowDown",
|
||||
"name": "arrow down"
|
||||
},
|
||||
{
|
||||
"id": "916394dd-7833-4875-8d7a-49d7d24ceeb2",
|
||||
"idName": "commandArrowLeft",
|
||||
"name": "arrow left"
|
||||
},
|
||||
{
|
||||
"id": "01e3df1e-638b-4e14-ba85-660267766062",
|
||||
"idName": "commandArrowRight",
|
||||
"name": "arrow right"
|
||||
},
|
||||
{
|
||||
"id": "257dfa59-0d38-4e18-a3fc-213809fdb12f",
|
||||
"idName": "commandOk",
|
||||
"name": "OK"
|
||||
},
|
||||
{
|
||||
"id": "ce4184b3-6b8e-4fc3-a4cb-7b8ec72f2ce9",
|
||||
"idName": "commandBack",
|
||||
"name": "back"
|
||||
},
|
||||
{
|
||||
"id": "33f941c1-f5fc-4449-b6e3-93eafca493e0",
|
||||
"idName": "commandHome",
|
||||
"name": "home"
|
||||
},
|
||||
{
|
||||
"id": "9a6e5111-95d3-49ac-8056-249e704b1509",
|
||||
"idName": "commandInputSource",
|
||||
"name": "input source"
|
||||
},
|
||||
{
|
||||
"id": "d76efdb8-056e-4b39-a839-2ef6d6001b00",
|
||||
"idName": "commandExit",
|
||||
"name": "exit"
|
||||
},
|
||||
{
|
||||
"id": "9c1290d5-3135-4124-a576-fc7522cffdcf",
|
||||
"idName": "commandInfo",
|
||||
"name": "info"
|
||||
},
|
||||
{
|
||||
"id": "47d65cac-fe75-4c36-9dee-9862c1c1130e",
|
||||
"idName": "commandMyApps",
|
||||
"name": "my apps"
|
||||
},
|
||||
{
|
||||
"id": "9aa3a97e-505d-4906-9764-14b6dc4e31e8",
|
||||
"idName": "commandProgramList",
|
||||
"name": "program list"
|
||||
}
|
||||
]
|
||||
|
||||
@ -223,18 +223,13 @@
|
||||
|
||||
#include "plugin/device.h"
|
||||
#include "devicemanager.h"
|
||||
#include "plugininfo.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QJsonDocument>
|
||||
#include <QVariantMap>
|
||||
#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()
|
||||
{
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
"deviceClasses": [
|
||||
{
|
||||
"deviceClassId": "3869884a-1592-4b8f-84a7-994be18ff555",
|
||||
"idName": "googleMail",
|
||||
"name": "Google Mail",
|
||||
"createMethods": ["user"],
|
||||
"paramTypes": [
|
||||
@ -27,6 +28,7 @@
|
||||
"actionTypes": [
|
||||
{
|
||||
"id": "054613b0-3666-4dad-9252-e0ebca187edc",
|
||||
"idName": "sendMail",
|
||||
"name": "Send mail",
|
||||
"paramTypes": [
|
||||
{
|
||||
@ -43,6 +45,7 @@
|
||||
},
|
||||
{
|
||||
"deviceClassId": "59409e8f-0c83-414f-abd5-bbbf2758acba",
|
||||
"idName": "yahooMail",
|
||||
"name": "Yahoo Mail",
|
||||
"createMethods": ["user"],
|
||||
"paramTypes": [
|
||||
@ -78,6 +81,7 @@
|
||||
},
|
||||
{
|
||||
"deviceClassId": "f4844c97-7ca6-4349-904e-ff9749a9fe74",
|
||||
"idName": "customMail",
|
||||
"name": "Custom Mail",
|
||||
"createMethods": ["user"],
|
||||
"paramTypes": [
|
||||
|
||||
@ -21,25 +21,11 @@
|
||||
|
||||
#include "plugin/device.h"
|
||||
#include "devicemanager.h"
|
||||
#include "plugininfo.h"
|
||||
|
||||
#include <QDebug>
|
||||
#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()
|
||||
{
|
||||
@ -99,12 +85,12 @@ void DevicePluginMock::deviceRemoved(Device *device)
|
||||
void DevicePluginMock::startMonitoringAutoDevices()
|
||||
{
|
||||
foreach (Device *device, myDevices()) {
|
||||
if (device->deviceClassId() == mockDeviceAutoClassId) {
|
||||
if (device->deviceClassId() == mockDeviceAutoDeviceClassId) {
|
||||
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;
|
||||
qsrand(QDateTime::currentMSecsSinceEpoch());
|
||||
@ -116,7 +102,7 @@ void DevicePluginMock::startMonitoringAutoDevices()
|
||||
QList<DeviceDescriptor> deviceDescriptorList;
|
||||
deviceDescriptorList.append(mockDescriptor);
|
||||
|
||||
emit autoDevicesAppeared(mockDeviceAutoClassId, deviceDescriptorList);
|
||||
emit autoDevicesAppeared(mockDeviceAutoDeviceClassId, deviceDescriptorList);
|
||||
}
|
||||
|
||||
QList<ParamType> DevicePluginMock::configurationDescription() const
|
||||
@ -138,13 +124,13 @@ DeviceManager::DeviceError DevicePluginMock::executeAction(Device *device, const
|
||||
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));
|
||||
QTimer::singleShot(1000, this, SLOT(emitActionExecuted()));
|
||||
return DeviceManager::DeviceErrorAsync;
|
||||
}
|
||||
|
||||
if (action.actionTypeId() == mockActionIdFailing) {
|
||||
if (action.actionTypeId() == mockFailingActionTypeId) {
|
||||
return DeviceManager::DeviceErrorSetupFailed;
|
||||
}
|
||||
|
||||
@ -217,10 +203,10 @@ void DevicePluginMock::emitDeviceSetupFinished()
|
||||
void DevicePluginMock::emitActionExecuted()
|
||||
{
|
||||
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());
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
"deviceClasses": [
|
||||
{
|
||||
"deviceClassId": "753f0d32-0468-4d08-82ed-1964aab03298",
|
||||
"idName": "mock",
|
||||
"name": "Mock Device",
|
||||
"createMethods": ["user", "discovery"],
|
||||
"discoveryParamTypes": [
|
||||
@ -84,20 +85,24 @@
|
||||
},
|
||||
{
|
||||
"id": "fbae06d3-7666-483e-a39e-ec50fe89054e",
|
||||
"idName": "mockAsync",
|
||||
"name": "Mock Action 3 (async)"
|
||||
},
|
||||
{
|
||||
"id": "df3cf33d-26d5-4577-9132-9823bd33fad0",
|
||||
"idName": "mockFailing",
|
||||
"name": "Mock Action 4 (broken)"
|
||||
},
|
||||
{
|
||||
"id": "bfe89a1d-3497-4121-8318-e77c37537219",
|
||||
"idName": "mockAsyncFailing",
|
||||
"name": "Mock Action 5 (async, broken)"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"deviceClassId": "ab4257b3-7548-47ee-9bd4-7dc3004fd197",
|
||||
"idName": "mockDeviceAuto",
|
||||
"name": "Mock Device (Auto created)",
|
||||
"createMethods": ["auto"],
|
||||
"paramTypes": [
|
||||
|
||||
@ -272,29 +272,13 @@
|
||||
|
||||
#include "plugin/device.h"
|
||||
#include "devicemanager.h"
|
||||
#include "plugininfo.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QJsonDocument>
|
||||
#include <QVariantMap>
|
||||
#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()
|
||||
{
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
"deviceClasses": [
|
||||
{
|
||||
"deviceClassId": "985195aa-17ad-4530-88a4-cdd753d747d7",
|
||||
"idName": "openweathermap",
|
||||
"name": "Weather from OpenWeatherMap",
|
||||
"createMethods": ["discovery"],
|
||||
"discoveryParamTypes": [
|
||||
@ -33,77 +34,90 @@
|
||||
"actionTypes": [
|
||||
{
|
||||
"id": "cfbc6504-d86f-4856-8dfa-97b6fbb385e4",
|
||||
"idName": "updateWeather",
|
||||
"name": "update"
|
||||
}
|
||||
],
|
||||
"stateTypes": [
|
||||
{
|
||||
"id": "36b2f09b-7d77-4fbc-a68f-23d735dda0b1",
|
||||
"idName": "updateTime",
|
||||
"name": "last update [unixtime]",
|
||||
"type": "uint",
|
||||
"defaultValue": "0"
|
||||
},
|
||||
{
|
||||
"id": "6013402f-b5b1-46b3-8490-f0c20d62fe61",
|
||||
"idName": "temperature",
|
||||
"name": "temperature [Celsius]",
|
||||
"type": "double",
|
||||
"defaultValue": "0"
|
||||
},
|
||||
{
|
||||
"id": "14ec2781-cb04-4bbf-b097-7d01ef982630",
|
||||
"idName": "temperatureMin",
|
||||
"name": "temperature minimum [Celsius]",
|
||||
"type": "double",
|
||||
"defaultValue": "0"
|
||||
},
|
||||
{
|
||||
"id": "fefe5563-452f-4833-b5cf-49c3cc67c772",
|
||||
"idName": "temperatureMax",
|
||||
"name": "temperature maximum [Celsius]",
|
||||
"type": "double",
|
||||
"defaultValue": "0"
|
||||
},
|
||||
{
|
||||
"id": "6f32ec73-3240-4630-ada9-1c10b8e98123",
|
||||
"idName": "humidity",
|
||||
"name": "humidity [%]",
|
||||
"type": "int",
|
||||
"defaultValue": "-1"
|
||||
},
|
||||
{
|
||||
"id": "4a42eea9-00eb-440b-915e-dbe42180f83b",
|
||||
"idName": "pressure",
|
||||
"name": "pressure [hPa]",
|
||||
"type": "double",
|
||||
"defaultValue": "0"
|
||||
},
|
||||
{
|
||||
"id": "2bf63430-e9e2-4fbf-88e6-6f1b4770f287",
|
||||
"idName": "windSpeed",
|
||||
"name": "wind speed [m/s]",
|
||||
"type": "double",
|
||||
"defaultValue": "0"
|
||||
},
|
||||
{
|
||||
"id": "589e2ea5-65b2-4afd-9b72-e3708a589a12",
|
||||
"idName": "windDirection",
|
||||
"name": "wind direction [degree]",
|
||||
"type": "int",
|
||||
"defaultValue": "0"
|
||||
},
|
||||
{
|
||||
"id": "798553bc-45c7-42eb-9105-430bddb5d9b7",
|
||||
"idName": "cloudiness",
|
||||
"name": "cloudiness [%]",
|
||||
"type": "int",
|
||||
"defaultValue": "0"
|
||||
},
|
||||
{
|
||||
"id": "f9539108-0e0e-4736-a306-6408f8e20a26",
|
||||
"idName": "weatherDescription",
|
||||
"name": "weather description",
|
||||
"type": "QString"
|
||||
},
|
||||
{
|
||||
"id": "af155e94-9492-44e1-8608-7d0ee8b5d50d",
|
||||
"idName": "sunset",
|
||||
"name": "sunset [timestamp]",
|
||||
"type": "uint",
|
||||
"defaultValue": "0"
|
||||
},
|
||||
{
|
||||
"id": "a1dddc3d-549f-4f20-b78b-be850548f286",
|
||||
"idName": "sunrise",
|
||||
"name": "sunrise [unixtime]",
|
||||
"type": "int",
|
||||
"defaultValue": "0"
|
||||
|
||||
@ -22,26 +22,12 @@
|
||||
#include "devicemanager.h"
|
||||
#include "types/param.h"
|
||||
#include "huebridgeconnection.h"
|
||||
#include "plugininfo.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QStringList>
|
||||
#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():
|
||||
m_discovery(new Discovery(this))
|
||||
{
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
"deviceClasses": [
|
||||
{
|
||||
"deviceClassId": "d8f4c397-e05e-47c1-8917-8e72d4d0d47c",
|
||||
"idName": "hue",
|
||||
"name": "Hue",
|
||||
"createMethods": ["discovery", "auto"],
|
||||
"setupMethod": "pushButton",
|
||||
@ -29,19 +30,36 @@
|
||||
"stateTypes": [
|
||||
{
|
||||
"id": "15794d26-fde8-4a61-8f83-d7830534975f",
|
||||
"idName": "hueReachable",
|
||||
"name": "reachable",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"id": "d25423e7-b924-4b20-80b6-77eecc65d089",
|
||||
"idName": "hueColor",
|
||||
"name": "color",
|
||||
"type": "color",
|
||||
"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": [
|
||||
{
|
||||
"id": "29cc299a-818b-47b2-817f-c5a6361545e4",
|
||||
"idName": "hueSetColor",
|
||||
"name": "Set color",
|
||||
"paramTypes": [
|
||||
{
|
||||
@ -52,6 +70,7 @@
|
||||
},
|
||||
{
|
||||
"id": "7782d91e-d73a-4321-8828-da768e2f6827",
|
||||
"idName": "hueSetPower",
|
||||
"name": "Set power",
|
||||
"paramTypes": [
|
||||
{
|
||||
@ -62,6 +81,7 @@
|
||||
},
|
||||
{
|
||||
"id": "3bc95552-cba0-4222-abd5-9b668132e442",
|
||||
"idName": "hueSetBrightness",
|
||||
"name": "Set brightness",
|
||||
"paramTypes": [
|
||||
{
|
||||
|
||||
@ -118,14 +118,12 @@
|
||||
|
||||
#include "plugin/device.h"
|
||||
#include "devicemanager.h"
|
||||
#include "plugininfo.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QStringList>
|
||||
#include <QUdpSocket>
|
||||
|
||||
DeviceClassId wolDeviceClassId = DeviceClassId("3c8f2447-dcd0-4882-8c09-99e579e4d24c");
|
||||
ActionTypeId wolActionTypeId = ActionTypeId("fb9b9d87-218f-4f0d-9e16-39f8a105029a");
|
||||
|
||||
DevicePluginWakeOnLan::DevicePluginWakeOnLan()
|
||||
{
|
||||
}
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
"actionTypes": [
|
||||
{
|
||||
"id": "fb9b9d87-218f-4f0d-9e16-39f8a105029a",
|
||||
"idName": "wol",
|
||||
"name": "Wake up device"
|
||||
}
|
||||
]
|
||||
|
||||
@ -129,16 +129,10 @@
|
||||
|
||||
#include "plugin/device.h"
|
||||
#include "devicemanager.h"
|
||||
#include "plugininfo.h"
|
||||
|
||||
#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()
|
||||
{
|
||||
m_discovery = new WemoDiscovery(this);
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
"deviceClasses": [
|
||||
{
|
||||
"deviceClassId": "69d97d3b-a8e6-42f3-afc0-ca8a53eb7cce",
|
||||
"idName": "wemoSwitch",
|
||||
"name": "WeMo Switch",
|
||||
"createMethods": ["discovery"],
|
||||
"paramTypes": [
|
||||
@ -55,12 +56,14 @@
|
||||
"stateTypes": [
|
||||
{
|
||||
"id": "7166c4f6-f68c-4188-8f7c-2205d72a5a6d",
|
||||
"idName": "power",
|
||||
"name": "power",
|
||||
"type": "bool",
|
||||
"defaultValue": false
|
||||
},
|
||||
{
|
||||
"id": "ec2f5b49-585c-4455-a233-b7aa4c608dbc",
|
||||
"idName": "reachable",
|
||||
"name": "reachable",
|
||||
"type": "bool",
|
||||
"defaultValue": false
|
||||
@ -69,6 +72,7 @@
|
||||
"actionTypes": [
|
||||
{
|
||||
"id": "269f25eb-d0b7-4144-b9ef-801f4ff3e90c",
|
||||
"idName": "power",
|
||||
"name": "set power",
|
||||
"type": "bool",
|
||||
"defaultValue": true
|
||||
|
||||
@ -20,13 +20,11 @@
|
||||
|
||||
#include "plugin/device.h"
|
||||
#include "devicemanager.h"
|
||||
#include "plugininfo.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QStringList>
|
||||
|
||||
DeviceClassId detectorId = DeviceClassId("bd216356-f1ec-4324-9785-6982d2174e17");
|
||||
StateTypeId inRangeStateTypeId = StateTypeId("cb43e1b5-4f61-4538-bfa2-c33055c542cf");
|
||||
|
||||
DevicePluginWifiDetector::DevicePluginWifiDetector()
|
||||
{
|
||||
}
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
"stateTypes": [
|
||||
{
|
||||
"id": "cb43e1b5-4f61-4538-bfa2-c33055c542cf",
|
||||
"idName": "inRange",
|
||||
"name": "In Range",
|
||||
"type": "bool",
|
||||
"defaultValue": false
|
||||
|
||||
86
plugins/generateplugininfo.py
Executable file
86
plugins/generateplugininfo.py
Executable 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")
|
||||
@ -3,8 +3,18 @@ include(../guh.pri)
|
||||
TEMPLATE = lib
|
||||
CONFIG += plugin
|
||||
|
||||
INCLUDEPATH += ../../../libguh
|
||||
INCLUDEPATH += $$top_srcdir/libguh
|
||||
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.depends += if
|
||||
INSTALLS += target
|
||||
|
||||
Reference in New Issue
Block a user