diff --git a/simulation/devicepluginsimulation.cpp b/simulation/devicepluginsimulation.cpp index 0b6e333e..4d49f3e8 100644 --- a/simulation/devicepluginsimulation.cpp +++ b/simulation/devicepluginsimulation.cpp @@ -280,6 +280,11 @@ DeviceManager::DeviceError DevicePluginSimulation::executeAction(Device *device, qCDebug(dcSimulation()) << "Garage gate not moving"; return DeviceManager::DeviceErrorNoError; } + if (action.actionTypeId() == garageGatePowerActionTypeId) { + bool power = action.param(garageGatePowerActionParamTypeId).value().toBool(); + device->setStateValue(garageGatePowerStateTypeId, power); + return DeviceManager::DeviceErrorNoError; + } } if (device->deviceClassId() == rollerShutterDeviceClassId) { diff --git a/simulation/devicepluginsimulation.json b/simulation/devicepluginsimulation.json index 6a190236..241a6628 100644 --- a/simulation/devicepluginsimulation.json +++ b/simulation/devicepluginsimulation.json @@ -263,7 +263,7 @@ "displayName": "Garage gate", "createMethods": ["user"], "deviceIcon": "Garage", - "interfaces": [ "garagegate" ], + "interfaces": [ "garagegate", "light" ], "paramTypes": [ ], "stateTypes": [ { @@ -282,6 +282,16 @@ "displayNameEvent": "Intermediate position changed", "type": "bool", "defaultValue": false + }, + { + "id": "46543561-2690-4072-a6a3-795e1c4f49a8", + "name": "power", + "displayName": "Light power", + "displayNameEvent": "Light power changed", + "displayNameAction": "Set light power", + "type": "bool", + "defaultValue": false, + "writable": true } ], "actionTypes": [