From b8f1386ad0316b2b5abb7fc70d3c53f444321104 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 14 Oct 2021 12:05:06 +0100 Subject: [PATCH] Dynamic MQTT connections (#3189) * add mqtt-control - adds auto-connect option to broker - add new node mqtt-control - adds i18n messages - adds documentation * documentation tweaks * built in documentation improvements * fix tip layout causing oversized editor * remove unused requires * add missing `unsubscribe` dropdown option - oddly forgotten - now added * ensure clientid is updated dynamically * [rewrite] move mqtt-control login into mqtt-in * Remove dynamic label * remove redundant mqtt-control code left overs * Callback for brokerConn.connect (improve done()) - done is now called on connect callback * fix race condition if connect/disconnect too fast - node.connected and node.client.connected getting out of sync * fix connection fail when switching protocol 3 ~ 5 - ensure protocolId is correct for protocolVersion * change msg.subscribe prop to `msg.topic` * unsub all topics if msg.topic is `true` * delete temprary debugger statements * Final rework of dynamic mqtt connections Co-authored-by: Steve-Mcl --- .../@node-red/nodes/core/network/10-mqtt.html | 115 +- .../@node-red/nodes/core/network/10-mqtt.js | 1157 ++++++++++------- .../nodes/locales/en-US/messages.json | 11 +- .../nodes/locales/en-US/network/10-mqtt.html | 56 + 4 files changed, 866 insertions(+), 473 deletions(-) diff --git a/packages/node_modules/@node-red/nodes/core/network/10-mqtt.html b/packages/node_modules/@node-red/nodes/core/network/10-mqtt.html index 406abf57d..747281ad0 100644 --- a/packages/node_modules/@node-red/nodes/core/network/10-mqtt.html +++ b/packages/node_modules/@node-red/nodes/core/network/10-mqtt.html @@ -54,6 +54,18 @@ width: 15px; height: 15px; } + .form-row-mqtt5 { + display: none; + } + .form-row-mqtt5.form-row-mqtt5-active:not(.form-row-mqtt-static-disabled) { + display: block + } + .form-row-mqtt-static-disabled { + display: none; + /* opacity: 0.3; + pointer-events: none; */ + } +