Merge pull request #4878 from node-red/4876-mqtt-status

Set status of mqtt nodes to "disconnected" when deregistered from broker
pull/4880/head
Nick O'Leary 2024-09-13 14:41:16 +01:00 committed by GitHub
commit a16c72b6a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -742,6 +742,7 @@ module.exports = function(RED) {
};
node.deregister = function(mqttNode, done, autoDisconnect) {
setStatusDisconnected(mqttNode, false);
delete node.users[mqttNode.id];
if (autoDisconnect && !node.closing && node.connected && Object.keys(node.users).length === 0) {
node.disconnect(done);