From faa7d948a747deaef2172b58c171448a6d105beb Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Mon, 27 Apr 2015 20:08:00 +0100 Subject: [PATCH] Update MQTT Out node status if already connected --- nodes/core/io/10-mqtt.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nodes/core/io/10-mqtt.js b/nodes/core/io/10-mqtt.js index 9a1b00511..ff014ad6b 100644 --- a/nodes/core/io/10-mqtt.js +++ b/nodes/core/io/10-mqtt.js @@ -119,7 +119,11 @@ module.exports = function(RED) { this.client.on("connect",function() { node.status({fill:"green",shape:"dot",text:"connected"}); }); - this.client.connect(); + if (this.client.isConnected()) { + node.status({fill:"green",shape:"dot",text:"connected"}); + } else { + this.client.connect(); + } } else { this.error("missing broker configuration"); }