From 7e0667475b28784c394cbc4825981b46647f82d8 Mon Sep 17 00:00:00 2001 From: Patrik Mayer Date: Mon, 3 Apr 2017 23:19:18 +0200 Subject: [PATCH] fixed error on deploying after editing the config node --- CHANGELOG.md | 3 +++ loxone/loxone.js | 23 ++++++++++++++--------- package.json | 2 +- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a1b6ad..78bf249 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### 0.2.1 +* fixed error on deploying after editing the config node + ### 0.2.0 * added online node * only controls shown regarding room/category on node editing diff --git a/loxone/loxone.js b/loxone/loxone.js index 7794fa9..7b060f0 100644 --- a/loxone/loxone.js +++ b/loxone/loxone.js @@ -403,16 +403,20 @@ module.exports = function (RED) { var node = RED.nodes.getNode(theNode.id); - node.status({ - fill: (online) ? 'green' : 'yellow', - shape: 'dot', - text: (online) ? 'online' : 'offline' - }); + if (node) { + node.status({ + fill: (online) ? 'green' : 'yellow', + shape: 'dot', + text: (online) ? 'online' : 'offline' + }); + + node.send({ + payload: online + }); + } - node.send({ - payload: online - }); } + }); } @@ -523,4 +527,5 @@ module.exports = function (RED) { RED.nodes.registerType('loxone-online', LoxoneOnlineNode); -}; +} +; diff --git a/package.json b/package.json index 82a268c..dd480ed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-red-contrib-loxone", - "version": "0.2.0", + "version": "0.2.1", "description": "Connecting the Loxone Miniserver to node-red via Websocket API", "license": "MIT", "keywords": [