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": [