Update mock parent/child actions

This commit is contained in:
Simon Stürz 2018-04-04 17:07:00 +02:00 committed by Michael Zanetti
parent b66a2a170c
commit ac95880175

View File

@ -302,14 +302,14 @@ DeviceManager::DeviceError DevicePluginMock::executeAction(Device *device, const
}
return DeviceManager::DeviceErrorActionTypeNotFound;
} else if (device->deviceClassId() == mockParentDeviceClassId) {
if (action.actionTypeId() == mockParentBoolValueParentActionTypeId) {
device->setStateValue(mockParentBoolValueParentStateTypeId, action.param(mockParentBoolValueParentActionParamTypeId).value().toBool());
if (action.actionTypeId() == mockParentBoolValueActionTypeId) {
device->setStateValue(mockParentBoolValueStateTypeId, action.param(mockParentBoolValueActionParamTypeId).value().toBool());
return DeviceManager::DeviceErrorNoError;
}
return DeviceManager::DeviceErrorActionTypeNotFound;
} else if (device->deviceClassId() == mockChildDeviceClassId) {
if (action.actionTypeId() == mockChildBoolValueParentActionTypeId) {
device->setStateValue(mockChildBoolValueParentStateTypeId, action.param(mockChildBoolValueParentActionParamTypeId).value().toBool());
if (action.actionTypeId() == mockChildBoolValueActionTypeId) {
device->setStateValue(mockChildBoolValueStateTypeId, action.param(mockChildBoolValueActionParamTypeId).value().toBool());
return DeviceManager::DeviceErrorNoError;
}
return DeviceManager::DeviceErrorActionTypeNotFound;