fixed state value of power devices

pull/1/head
nymea 2019-06-08 23:26:20 +02:00
parent 602c71e105
commit 2d1ff9ab42
1 changed files with 3 additions and 0 deletions

View File

@ -142,6 +142,7 @@ DeviceManager::DeviceError DevicePluginGenericInterfaces::executeAction(Device *
if (device->deviceClassId() == socketDeviceClassId) {
if (action.actionTypeId() == socketPowerActionTypeId) {
device->setStateValue(socketPowerStateTypeId, action.param(socketPowerActionPowerParamTypeId).value());
return DeviceManager::DeviceErrorNoError;
}
return DeviceManager::DeviceErrorActionTypeNotFound;
@ -149,6 +150,7 @@ DeviceManager::DeviceError DevicePluginGenericInterfaces::executeAction(Device *
if (device->deviceClassId() == lightDeviceClassId) {
if (action.actionTypeId() == lightPowerActionTypeId) {
device->setStateValue(lightPowerStateTypeId, action.param(lightPowerActionPowerParamTypeId).value());
return DeviceManager::DeviceErrorNoError;
}
return DeviceManager::DeviceErrorActionTypeNotFound;
@ -156,6 +158,7 @@ DeviceManager::DeviceError DevicePluginGenericInterfaces::executeAction(Device *
if (device->deviceClassId() == heatingDeviceClassId) {
if (action.actionTypeId() == heatingPowerActionTypeId) {
device->setStateValue(heatingPowerStateTypeId, action.param(heatingPowerActionPowerParamTypeId).value());
return DeviceManager::DeviceErrorNoError;
}
return DeviceManager::DeviceErrorActionTypeNotFound;