update plugins according to new id generation mechanism

pull/1/head
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
if (device->deviceClassId() == toggleButtonDeviceClassId ) {
if (action.actionTypeId() == stateActionTypeId) {
device->setStateValue(stateStateTypeId, !device->stateValue(stateStateTypeId).toBool());
if (action.actionTypeId() == toggleButtonStateActionTypeId) {
device->setStateValue(toggleButtonStateStateTypeId, !device->stateValue(toggleButtonStateStateTypeId).toBool());
return DeviceManager::DeviceErrorNoError;
}
return DeviceManager::DeviceErrorActionTypeNotFound;
}
// Button
if (device->deviceClassId() == buttonDeviceClassId ) {
if (action.actionTypeId() == buttonPressActionTypeId) {
emit emitEvent(Event(buttonPressedEventTypeId, device->id()));
if (action.actionTypeId() == buttonButtonPressActionTypeId) {
emit emitEvent(Event(buttonButtonPressedEventTypeId, device->id()));
return DeviceManager::DeviceErrorNoError;
}
return DeviceManager::DeviceErrorActionTypeNotFound;

View File

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