1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Update MQTT Out node status if already connected

This commit is contained in:
Nick O'Leary 2015-04-27 20:08:00 +01:00
parent 771342989e
commit faa7d948a7

View File

@ -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");
}