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:
parent
771342989e
commit
faa7d948a7
@ -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");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user