diff --git a/genericthings/integrationplugingenericthings.cpp b/genericthings/integrationplugingenericthings.cpp index 843f2e20..754a848b 100644 --- a/genericthings/integrationplugingenericthings.cpp +++ b/genericthings/integrationplugingenericthings.cpp @@ -625,6 +625,18 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info) return; } + Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); + } else if (thing->thingClassId() == thermostatThingClassId) { + if (action.actionTypeId() == thermostatTargetTemperatureActionTypeId) { + thing->setStateValue(thermostatTargetTemperatureStateTypeId, action.param(thermostatTargetTemperatureActionTargetTemperatureParamTypeId).value()); + info->finish(Thing::ThingErrorNoError); + return; + } + if (action.actionTypeId() == thermostatPowerActionTypeId) { + thing->setStateValue(thermostatPowerStateTypeId, action.param(thermostatPowerActionPowerParamTypeId).value()); + info->finish(Thing::ThingErrorNoError); + return; + } Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8()); } else { Q_ASSERT_X(false, "executeAction", QString("Unhandled thingClassId: %1").arg(thing->thingClassId().toString()).toUtf8()); diff --git a/genericthings/integrationplugingenericthings.json b/genericthings/integrationplugingenericthings.json index 190706e9..e9f06106 100644 --- a/genericthings/integrationplugingenericthings.json +++ b/genericthings/integrationplugingenericthings.json @@ -1029,6 +1029,40 @@ "ioType": "digitalOutput" } ] + }, + { + "id": "6a34ba99-e5ec-4fc9-a61f-695ed8573fa1", + "name": "thermostat", + "displayName": "Generic thermostat", + "createMethods": ["user"], + "interfaces": ["thermostat", "heating"], + "stateTypes": [ + { + "id": "60169ebf-c1e3-41ed-a1bb-4b858e93ec50", + "name": "targetTemperature", + "displayName": "Target temperature", + "displayNameEvent": "Target temperature changed", + "displayNameAction": "Set target temperature", + "type": "double", + "defaultValue": 21, + "minValue": -20, + "maxValue": 50, + "unit": "DegreeCelsius", + "writable": true, + "ioType": "analogInput" + }, + { + "id": "1f6a0c39-4417-4e31-86db-9926cf81c345", + "name": "power", + "displayName": "On/off", + "displayNameEvent": "Turned on/off", + "displayNameAction": "Turn on/off", + "type": "bool", + "defaultValue": false, + "writable": true, + "ioType": "digitalInput" + } + ] } ] } diff --git a/genericthings/translations/b3188696-2585-4806-bf98-30ab576ce5c8-de.ts b/genericthings/translations/b3188696-2585-4806-bf98-30ab576ce5c8-de.ts index 2777f39e..11dfcaf1 100644 --- a/genericthings/translations/b3188696-2585-4806-bf98-30ab576ce5c8-de.ts +++ b/genericthings/translations/b3188696-2585-4806-bf98-30ab576ce5c8-de.ts @@ -794,6 +794,49 @@ The name of the StateType ({e645a979-1465-4592-b8b0-f4c123db0800}) of ThingClass The name of the EventType ({e645a979-1465-4592-b8b0-f4c123db0800}) of ThingClass pressureSensor + + Generic thermostat + The name of the ThingClass ({6a34ba99-e5ec-4fc9-a61f-695ed8573fa1}) + + + + On/off + The name of the ParamType (ThingClass: thermostat, ActionType: power, ID: {1f6a0c39-4417-4e31-86db-9926cf81c345}) +---------- +The name of the ParamType (ThingClass: thermostat, EventType: power, ID: {1f6a0c39-4417-4e31-86db-9926cf81c345}) +---------- +The name of the StateType ({1f6a0c39-4417-4e31-86db-9926cf81c345}) of ThingClass thermostat + + + + Set target temperature + The name of the ActionType ({60169ebf-c1e3-41ed-a1bb-4b858e93ec50}) of ThingClass thermostat + + + + Target temperature + The name of the ParamType (ThingClass: thermostat, ActionType: targetTemperature, ID: {60169ebf-c1e3-41ed-a1bb-4b858e93ec50}) +---------- +The name of the ParamType (ThingClass: thermostat, EventType: targetTemperature, ID: {60169ebf-c1e3-41ed-a1bb-4b858e93ec50}) +---------- +The name of the StateType ({60169ebf-c1e3-41ed-a1bb-4b858e93ec50}) of ThingClass thermostat + + + + Target temperature changed + The name of the EventType ({60169ebf-c1e3-41ed-a1bb-4b858e93ec50}) of ThingClass thermostat + + + + Turn on/off + The name of the ActionType ({1f6a0c39-4417-4e31-86db-9926cf81c345}) of ThingClass thermostat + + + + Turned on/off + The name of the EventType ({1f6a0c39-4417-4e31-86db-9926cf81c345}) of ThingClass thermostat + + IntegrationPluginGenericThings diff --git a/genericthings/translations/b3188696-2585-4806-bf98-30ab576ce5c8-en_US.ts b/genericthings/translations/b3188696-2585-4806-bf98-30ab576ce5c8-en_US.ts index c833ffc5..daf51c42 100644 --- a/genericthings/translations/b3188696-2585-4806-bf98-30ab576ce5c8-en_US.ts +++ b/genericthings/translations/b3188696-2585-4806-bf98-30ab576ce5c8-en_US.ts @@ -794,6 +794,49 @@ The name of the StateType ({0cc74edb-7116-47cf-953a-409933f26557}) of ThingClass The name of the EventType ({0cc74edb-7116-47cf-953a-409933f26557}) of ThingClass extendedStatefulGaragedoor + + Generic thermostat + The name of the ThingClass ({6a34ba99-e5ec-4fc9-a61f-695ed8573fa1}) + + + + On/off + The name of the ParamType (ThingClass: thermostat, ActionType: power, ID: {1f6a0c39-4417-4e31-86db-9926cf81c345}) +---------- +The name of the ParamType (ThingClass: thermostat, EventType: power, ID: {1f6a0c39-4417-4e31-86db-9926cf81c345}) +---------- +The name of the StateType ({1f6a0c39-4417-4e31-86db-9926cf81c345}) of ThingClass thermostat + + + + Set target temperature + The name of the ActionType ({60169ebf-c1e3-41ed-a1bb-4b858e93ec50}) of ThingClass thermostat + + + + Target temperature + The name of the ParamType (ThingClass: thermostat, ActionType: targetTemperature, ID: {60169ebf-c1e3-41ed-a1bb-4b858e93ec50}) +---------- +The name of the ParamType (ThingClass: thermostat, EventType: targetTemperature, ID: {60169ebf-c1e3-41ed-a1bb-4b858e93ec50}) +---------- +The name of the StateType ({60169ebf-c1e3-41ed-a1bb-4b858e93ec50}) of ThingClass thermostat + + + + Target temperature changed + The name of the EventType ({60169ebf-c1e3-41ed-a1bb-4b858e93ec50}) of ThingClass thermostat + + + + Turn on/off + The name of the ActionType ({1f6a0c39-4417-4e31-86db-9926cf81c345}) of ThingClass thermostat + + + + Turned on/off + The name of the EventType ({1f6a0c39-4417-4e31-86db-9926cf81c345}) of ThingClass thermostat + + IntegrationPluginGenericThings