update plugins according to new id generation mechanism

This commit is contained in:
Michael Zanetti 2017-11-16 12:50:45 +01:00
parent a3c023cfbb
commit 4756ebe54f
2 changed files with 8 additions and 8 deletions

View File

@ -83,16 +83,16 @@ DeviceManager::DeviceError DevicePluginGenericElements::executeAction(Device *de
{ {
// Toggle Button // Toggle Button
if (device->deviceClassId() == toggleButtonDeviceClassId ) { if (device->deviceClassId() == toggleButtonDeviceClassId ) {
if (action.actionTypeId() == stateActionTypeId) { if (action.actionTypeId() == toggleButtonStateActionTypeId) {
device->setStateValue(stateStateTypeId, !device->stateValue(stateStateTypeId).toBool()); device->setStateValue(toggleButtonStateStateTypeId, !device->stateValue(toggleButtonStateStateTypeId).toBool());
return DeviceManager::DeviceErrorNoError; return DeviceManager::DeviceErrorNoError;
} }
return DeviceManager::DeviceErrorActionTypeNotFound; return DeviceManager::DeviceErrorActionTypeNotFound;
} }
// Button // Button
if (device->deviceClassId() == buttonDeviceClassId ) { if (device->deviceClassId() == buttonDeviceClassId ) {
if (action.actionTypeId() == buttonPressActionTypeId) { if (action.actionTypeId() == buttonButtonPressActionTypeId) {
emit emitEvent(Event(buttonPressedEventTypeId, device->id())); emit emitEvent(Event(buttonButtonPressedEventTypeId, device->id()));
return DeviceManager::DeviceErrorNoError; return DeviceManager::DeviceErrorNoError;
} }
return DeviceManager::DeviceErrorActionTypeNotFound; return DeviceManager::DeviceErrorActionTypeNotFound;

View File

@ -74,24 +74,24 @@
"actionTypes": [ "actionTypes": [
{ {
"id": "892596d2-0863-4807-97da-469b9f7003f2", "id": "892596d2-0863-4807-97da-469b9f7003f2",
"name": "onOffButtonOn", "name": "on",
"displayName": "press ON" "displayName": "press ON"
}, },
{ {
"id": "a8d64050-0b58-4ccf-b052-77ce2b7368ad", "id": "a8d64050-0b58-4ccf-b052-77ce2b7368ad",
"name": "onOffButtonOff", "name": "off",
"displayName": "press OFF" "displayName": "press OFF"
} }
], ],
"eventTypes": [ "eventTypes": [
{ {
"id": "4eeba6a2-e4c7-4a2e-8360-2797d98114e6", "id": "4eeba6a2-e4c7-4a2e-8360-2797d98114e6",
"name": "onOffButtonOn", "name": "on",
"displayName": "ON pressed" "displayName": "ON pressed"
}, },
{ {
"id": "b636c5f3-2eb0-4682-96d4-88a4aa9d2c12", "id": "b636c5f3-2eb0-4682-96d4-88a4aa9d2c12",
"name": "onOffButtonOff", "name": "off",
"displayName": "OFF pressed" "displayName": "OFF pressed"
} }
] ]