From be810be2e244a6d611063501b86e7077a2bc5924 Mon Sep 17 00:00:00 2001 From: Dave C-J Date: Sat, 31 May 2014 20:08:15 +0100 Subject: [PATCH] tweak node.status to be consistent with latest thinking stomp, xmpp and suncalc. --- io/stomp/18-stomp.js | 18 +++++++++--------- social/xmpp/92-xmpp.js | 12 ++++++------ time/79-suncalc.js | 4 ++-- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/io/stomp/18-stomp.js b/io/stomp/18-stomp.js index f2c56eec..adbadb8e 100644 --- a/io/stomp/18-stomp.js +++ b/io/stomp/18-stomp.js @@ -86,31 +86,31 @@ module.exports = function(RED) { var closing = false; node.client = new StompClient(node.host, node.port, node.userid, node.password, '1.0'); - node.status({fill:"grey",shape:"ring",text:"connecting"},true); + node.status({fill:"grey",shape:"ring",text:"connecting"}); var doConnect = function() { node.client.connect(function(sessionId) { - node.status({fill:"green",shape:"dot",text:"connected"},true); + node.status({fill:"green",shape:"dot",text:"connected"}); node.log('subscribed to: '+node.topic); node.client.subscribe(node.topic, function(body, headers) { msg.payload = JSON.parse(body); node.send(msg); }); }, function(error) { - node.status({fill:"grey",shape:"dot",text:"error"},true); + node.status({fill:"grey",shape:"dot",text:"error"}); node.warn(error); }); } node.client.on("disconnect", function() { - node.status({fill:"red",shape:"ring",text:"disconnected"},true); + node.status({fill:"red",shape:"ring",text:"disconnected"}); if (!closing) { setTimeout( function () { doConnect(); }, 15000); } }); node.client.on("error", function(error) { - node.status({fill:"grey",shape:"dot",text:"error"},true); + node.status({fill:"grey",shape:"dot",text:"error"}); node.log(error); }); @@ -146,17 +146,17 @@ module.exports = function(RED) { var closing = false; node.client = new StompClient(node.host, node.port, node.userid, node.password, '1.0'); - node.status({fill:"grey",shape:"ring",text:"connecting"},true); + node.status({fill:"grey",shape:"ring",text:"connecting"}); node.client.connect( function(sessionId) { - node.status({fill:"green",shape:"dot",text:"connected"},true); + node.status({fill:"green",shape:"dot",text:"connected"}); }, function(error) { - node.status({fill:"grey",shape:"dot",text:"error"},true); + node.status({fill:"grey",shape:"dot",text:"error"}); node.warn(error); }); node.client.on("disconnect", function() { - node.status({fill:"red",shape:"ring",text:"disconnected"},true); + node.status({fill:"red",shape:"ring",text:"disconnected"}); if (!closing) { setTimeout( function () { node.client.connect(); }, 15000); } diff --git a/social/xmpp/92-xmpp.js b/social/xmpp/92-xmpp.js index bc2aa4d0..8bcb2955 100644 --- a/social/xmpp/92-xmpp.js +++ b/social/xmpp/92-xmpp.js @@ -98,7 +98,7 @@ function XmppInNode(n) { xmpp.on('online', function() { node.log('connected to '+node.host+":"+node.port); - node.status({fill:"green",shape:"dot",text:"connected"},true); + node.status({fill:"green",shape:"dot",text:"connected"}); //xmpp.setPresence('online', node.nick+' online'); if (node.join) { xmpp.join(node.to+'/'+node.nick); @@ -133,7 +133,7 @@ function XmppInNode(n) { xmpp.on('close', function(err) { node.log('connection closed'); - node.status({fill:"red",shape:"ring",text:"not connected"},true); + node.status({fill:"red",shape:"ring",text:"not connected"}); }); xmpp.on('subscribe', function(from) { @@ -152,7 +152,7 @@ function XmppInNode(n) { }); } catch(e) { node.error("Bad xmpp configuration"); - node.status({fill:"red",shape:"ring",text:"not connected"},true); + node.status({fill:"red",shape:"ring",text:"not connected"}); } node.on("close", function(done) { @@ -184,7 +184,7 @@ function XmppOutNode(n) { xmpp.on('online', function() { node.log('connected to '+node.host+":"+node.port); - node.status({fill:"green",shape:"dot",text:"connected"},true); + node.status({fill:"green",shape:"dot",text:"connected"}); xmpp.setPresence('online', node.nick+' online'); if (node.join) { xmpp.join(node.to+'/'+node.nick); @@ -197,7 +197,7 @@ function XmppOutNode(n) { xmpp.on('close', function(err) { node.log('connection closed'); - node.status({fill:"red",shape:"ring",text:"not connected"},true); + node.status({fill:"red",shape:"ring",text:"not connected"}); }); xmpp.on('subscribe', function(from) { @@ -216,7 +216,7 @@ function XmppOutNode(n) { }); } catch(e) { node.error("Bad xmpp configuration"); - node.status({fill:"red",shape:"ring",text:"not connected"},true); + node.status({fill:"red",shape:"ring",text:"not connected"}); } node.on("input", function(msg) { diff --git a/time/79-suncalc.js b/time/79-suncalc.js index 942d4aa2..6e2d3096 100644 --- a/time/79-suncalc.js +++ b/time/79-suncalc.js @@ -42,8 +42,8 @@ module.exports = function(RED) { msg = { payload:0, topic:"sun", moon:moon }; if ((e1 > 0) & (e2 < 0)) { msg.payload = 1; } if (oldval == null) { oldval = msg.payload; } - if (msg.payload == 1) { node.status({fill:"yellow",shape:"dot",text:"day"},true); } - else { node.status({fill:"blue",shape:"dot",text:"night"},true); } + if (msg.payload == 1) { node.status({fill:"yellow",shape:"dot",text:"day"}); } + else { node.status({fill:"blue",shape:"dot",text:"night"}); } if (msg.payload != oldval) { oldval = msg.payload; msg2 = msg;