From c3ea5d0efbed62b452f3892fc27dbc5864d64a3c Mon Sep 17 00:00:00 2001 From: Marvin Schenkel Date: Mon, 14 Mar 2016 23:15:24 +0100 Subject: [PATCH] Added device args Added device args to flow triggers --- app.json | 43 ++++++++++++++++++++++++++++++++++++++---- drivers/kodi/driver.js | 2 +- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/app.json b/app.json index 7a74325..d3ae900 100644 --- a/app.json +++ b/app.json @@ -148,6 +148,13 @@ "title": { "en":"A movie has started" }, + "args": [ + { + "name": "kodi", + "type": "device", + "filter": "driver_uri=homey:app:nl.marvinschenkel.kodi&driver_id=kodi" + } + ], "tokens":[ { "name":"movie_title", @@ -165,6 +172,13 @@ "title": { "en":"An episode has started" }, + "args": [ + { + "name": "kodi", + "type": "device", + "filter": "driver_uri=homey:app:nl.marvinschenkel.kodi&driver_id=kodi" + } + ], "tokens":[ { "name":"tvshow_title", @@ -208,19 +222,40 @@ "id":"kodi_pause", "title": { "en":"Kodi has been paused" - } + }, + "args": [ + { + "name": "kodi", + "type": "device", + "filter": "driver_uri=homey:app:nl.marvinschenkel.kodi&driver_id=kodi" + } + ] }, { "id":"kodi_resume", "title": { "en":"Kodi has been resumed" - } + }, + "args": [ + { + "name": "kodi", + "type": "device", + "filter": "driver_uri=homey:app:nl.marvinschenkel.kodi&driver_id=kodi" + } + ] }, { - "id":"kodi_stop", + "id":"kodi_stop", "title": { "en":"Kodi has been stopped" - } + }, + "args": [ + { + "name": "kodi", + "type": "device", + "filter": "driver_uri=homey:app:nl.marvinschenkel.kodi&driver_id=kodi" + } + ] } ], "actions":[ diff --git a/drivers/kodi/driver.js b/drivers/kodi/driver.js index 29f120b..7e456bd 100644 --- a/drivers/kodi/driver.js +++ b/drivers/kodi/driver.js @@ -60,7 +60,7 @@ module.exports.pair = function (socket) { } // Device gets deleted -module.exports.deleted = function (device_data) { +module.exports.deleted = function (device_data) { // Create a new array without the deleted device registeredDevices = registeredDevices.filter(function (item) { return item.host !== device_data.id