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
1 changed files with 5 additions and 1 deletions

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