From eff573ce78d668f399a743a83d945974b25e35f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Tue, 7 Apr 2015 12:34:25 +0200 Subject: [PATCH] fixed deviceplugintune.json added icons --- .../deviceplugins/tune/deviceplugintune.cpp | 8 +-- .../deviceplugins/tune/deviceplugintune.json | 72 ++++++------------- 2 files changed, 27 insertions(+), 53 deletions(-) diff --git a/plugins/deviceplugins/tune/deviceplugintune.cpp b/plugins/deviceplugins/tune/deviceplugintune.cpp index 3baaa7e7..d26d9baf 100644 --- a/plugins/deviceplugins/tune/deviceplugintune.cpp +++ b/plugins/deviceplugins/tune/deviceplugintune.cpp @@ -270,13 +270,13 @@ DeviceManager::DeviceError DevicePluginTune::executeAction(Device *device, const // Mood if (device->deviceClassId() == moodDeviceClassId) { - if (action.actionTypeId() == toggleActionTypeId) { + if (action.actionTypeId() == activeActionTypeId) { bool currentState = device->stateValue(activeStateTypeId).toBool(); device->setStateValue(activeStateTypeId, !currentState); syncStates(device); return DeviceManager::DeviceErrorNoError; } - if (action.actionTypeId() == setValueActionTypeId) { + if (action.actionTypeId() == valueActionTypeId) { device->setStateValue(valueStateTypeId, action.param("percentage").value().toInt()); syncStates(device); return DeviceManager::DeviceErrorNoError; @@ -285,13 +285,13 @@ DeviceManager::DeviceError DevicePluginTune::executeAction(Device *device, const } if (device->deviceClassId() == tuneDeviceClassId) { - if (action.actionTypeId() == toggleLightActionTypeId) { + if (action.actionTypeId() == powerActionTypeId) { bool currentState = device->stateValue(powerStateTypeId).toBool(); device->setStateValue(powerStateTypeId, !currentState); syncStates(device); return DeviceManager::DeviceErrorNoError; } - if (action.actionTypeId() == setBrightnessActionTypeId) { + if (action.actionTypeId() == brightnessActionTypeId) { device->setStateValue(brightnessStateTypeId, action.param("brightness").value().toInt()); syncStates(device); return DeviceManager::DeviceErrorNoError; diff --git a/plugins/deviceplugins/tune/deviceplugintune.json b/plugins/deviceplugins/tune/deviceplugintune.json index 88c9617d..7b23387b 100644 --- a/plugins/deviceplugins/tune/deviceplugintune.json +++ b/plugins/deviceplugins/tune/deviceplugintune.json @@ -25,16 +25,24 @@ "name": "icon", "type": "QString", "allowedValues": [ + "IconBed", + "IconBlinds", + "IconCeilingLamp", "IconCouch", - "IconTv", + "IconDeskLamp", + "IconDesk", + "IconHifi", "IconLamp", - "IconLamp1", - "IconLamp2", - "IconLamp3", + "IconRadio", + "IconSmartPhone", "IconSmoking", "IconSocket", + "IconStandardLamp", + "IconSun", + "IconTablet", "IconThermometer", - "IconWork" + "IconTune", + "IconTv" ] } ], @@ -44,34 +52,18 @@ "idName": "active", "name": "active", "type": "bool", - "defaultValue": false + "defaultValue": false, + "writable": true }, { "id": "cb8a89c2-dc12-4965-b047-57896058b421", "idName": "value", "name": "value", "type": "int", - "defaultValue": 50 - } - ], - "actionTypes": [ - { - "id": "768b6a17-731b-4976-bc9e-15c04eff7df3", - "idName": "toggle", - "name": "toggle" - }, - { - "id": "fe942f70-b8fb-413b-8feb-2dd924b9f649", - "idName": "setValue", - "name": "set value", - "paramTypes": [ - { - "name": "percentage", - "type": "int", - "minimumValue": 0, - "maximumValue": 100 - } - ] + "minimumValue": 0, + "maximumValue": 100, + "defaultValue": 50, + "writable": true } ] }, @@ -123,33 +115,15 @@ "id": "6c049f8f-408f-4265-a4f7-46a855d5c340", "idName": "power", "name": "power", - "type": "bool" + "type": "bool", + "writable": true }, { "id": "677cd9ec-c264-47ee-9d2e-d3662237792c", "idName": "brightness", "name": "brightness", - "type": "int" - } - ], - "actionTypes": [ - { - "id": "cfc35f13-2a17-4c7b-9343-b5bd8a242eef", - "idName": "setBrightness", - "name": "set brightness", - "paramTypes": [ - { - "name": "brightness", - "type": "int", - "minimumValue": 0, - "maximumValue": 100 - } - ] - }, - { - "id": "36c3cb61-45ee-4549-a0f9-cf34f0efae2b", - "idName": "toggleLight", - "name": "toggle light" + "type": "int", + "writable": true } ] }