From 69556eb0dc7ea4e8fd8fc5a3a2ab2e170c1a8962 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Sat, 21 Oct 2017 00:09:21 +0200 Subject: [PATCH] some interfaces work (kodi and openweathermap) --- kodi/devicepluginkodi.cpp | 23 +++++++++ kodi/devicepluginkodi.json | 47 +++++++++++++++++++ .../devicepluginopenweathermap.json | 1 + 3 files changed, 71 insertions(+) diff --git a/kodi/devicepluginkodi.cpp b/kodi/devicepluginkodi.cpp index 299d67c6..ce0f2f53 100644 --- a/kodi/devicepluginkodi.cpp +++ b/kodi/devicepluginkodi.cpp @@ -167,6 +167,29 @@ DeviceManager::DeviceError DevicePluginKodi::executeAction(Device *device, const } else if (action.actionTypeId() == kodiAudioLibraryActionTypeId) { kodi->audioLibrary(action.param(kodiAudioCommandParamTypeId).value().toString(), action.id()); return DeviceManager::DeviceErrorAsync; + } else if(action.actionTypeId() == skipBackActionTypeId) { + kodi->pressButton("skipprevious", action.id()); + return DeviceManager::DeviceErrorAsync; + } else if(action.actionTypeId() == rewindActionTypeId) { + kodi->pressButton("rewind", action.id()); + return DeviceManager::DeviceErrorAsync; + } else if(action.actionTypeId() == stopActionTypeId) { + kodi->pressButton("stop", action.id()); + return DeviceManager::DeviceErrorAsync; + } else if(action.actionTypeId() == playActionTypeId) { + kodi->pressButton("play", action.id()); + return DeviceManager::DeviceErrorAsync; + } else if(action.actionTypeId() == pauseActionTypeId) { + kodi->pressButton("pause", action.id()); + return DeviceManager::DeviceErrorAsync; + } else if(action.actionTypeId() == fastForwardActionTypeId) { + kodi->pressButton("fastforward", action.id()); + return DeviceManager::DeviceErrorAsync; + } else if(action.actionTypeId() == skipNextActionTypeId) { + kodi->pressButton("skipnext", action.id()); + return DeviceManager::DeviceErrorAsync; + } else { + qWarning(dcKodi()) << "Unhandled action type" << action.actionTypeId(); } return DeviceManager::DeviceErrorActionTypeNotFound; } diff --git a/kodi/devicepluginkodi.json b/kodi/devicepluginkodi.json index eefdab06..3448b1db 100644 --- a/kodi/devicepluginkodi.json +++ b/kodi/devicepluginkodi.json @@ -78,7 +78,19 @@ "eventRuleRelevant": false, "defaultValue": 50, "writable": true + }, + { + "id": "2dd512b7-40c2-488e-8d4f-6519edaa6f74", + "name": "playbackStatus", + "displayName": "playback status", + "type": "QString", + "possibleValues": ["Playing", "Paused", "Stopped"], + "defaultValue": "Stopped", + "displayNameEvent": "playback status changed", + "displayNameAction": "set playback status", + "writable": true } + ], "eventTypes": [ { @@ -98,6 +110,41 @@ } ], "actionTypes": [ + { + "id": "a180807d-1265-4831-9d86-a421767418dd", + "name": "skipBack", + "displayName": "skip back" + }, + { + "id": "7e70b47b-7e79-4521-be34-04a3c427e5b1", + "name": "rewind", + "displayName": "rewind" + }, + { + "id": "ae3cbe03-ee3e-410e-abbd-efabc2402198", + "name": "stop", + "displayName": "stop" + }, + { + "id": "4d2ee668-a2e3-4795-8b96-0c800b703b46", + "name": "play", + "displayName": "play" + }, + { + "id": "3cf341cb-fe63-40bc-a450-9678d18e91e3", + "name": "pause", + "displayName": "pause" + }, + { + "id": "6985250e-1188-4e44-b9dd-93303b5738a1", + "name": "fastForward", + "displayName": "fastForward" + }, + { + "id": "85d7126a-b123-4a28-aeb4-d84bcfb4d14f", + "name": "skipNext", + "displayName": "skipNext" + }, { "id": "dc0aa3b5-4eae-4e58-a4ac-d4c124da53f1", "name": "showNotification", diff --git a/openweathermap/devicepluginopenweathermap.json b/openweathermap/devicepluginopenweathermap.json index f3248ee9..f982b2a3 100644 --- a/openweathermap/devicepluginopenweathermap.json +++ b/openweathermap/devicepluginopenweathermap.json @@ -18,6 +18,7 @@ "Weather", "Sensor" ], + "interfaces": ["weather"], "createMethods": ["discovery"], "primaryStateTypeId": "6013402f-b5b1-46b3-8490-f0c20d62fe61", "primaryActionTypeId": "cfbc6504-d86f-4856-8dfa-97b6fbb385e4",