node-red-contrib-dmx-for-ha 0.3.8 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/nodes/ha-mqtt-button.js
CHANGED
|
@@ -56,7 +56,7 @@ module.exports = function (RED) {
|
|
|
56
56
|
// but still respect cooldown to prevent accidental rapid-fire
|
|
57
57
|
const now = Date.now();
|
|
58
58
|
if (now - _lastDiscoveryTime < _DISCOVERY_COOLDOWN_MS) {
|
|
59
|
-
node.
|
|
59
|
+
if (S.debugMode) node.debug('Discovery cooldown active — skipping duplicate auto-discover');
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
62
|
_lastDiscoveryTime = now;
|
|
@@ -59,7 +59,7 @@ module.exports = function (RED) {
|
|
|
59
59
|
// but still respect cooldown to prevent accidental rapid-fire
|
|
60
60
|
const now = Date.now();
|
|
61
61
|
if (now - _lastDiscoveryTime < _DISCOVERY_COOLDOWN_MS) {
|
|
62
|
-
node.
|
|
62
|
+
if (S.debugMode) node.debug('Discovery cooldown active — skipping duplicate auto-discover');
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
65
|
_lastDiscoveryTime = now;
|
|
@@ -285,14 +285,11 @@ module.exports = function (RED) {
|
|
|
285
285
|
forwardToChildren(payload, null);
|
|
286
286
|
const _lbl = payload.effect ? `effect:${payload.effect}` : `${payload.state}`;
|
|
287
287
|
setStatus('green', 'dot', `${groupId} → ${_lbl}`);
|
|
288
|
-
setTimeout(() => setStatus('yellow', 'ring', `${groupId} ready`), 3000);
|
|
289
288
|
}, node.id);
|
|
290
289
|
|
|
291
290
|
setStatus('green', 'ring', `${groupId} discovery sent`);
|
|
292
291
|
node.log(`Group device added: "${S.groupName || groupId}"`);
|
|
293
292
|
|
|
294
|
-
// Forward device:add to children via Link so they self-discover
|
|
295
|
-
node.send([{ device: 'add' }]);
|
|
296
293
|
|
|
297
294
|
// Recovery
|
|
298
295
|
setTimeout(() => {
|
|
@@ -331,7 +328,6 @@ module.exports = function (RED) {
|
|
|
331
328
|
pubState({ state: msg.payload.state, color_mode: S.colorMode, brightness: msg.payload.brightness });
|
|
332
329
|
forwardToChildren(msg.payload, msg.dmx_trace);
|
|
333
330
|
setStatus('green', 'dot', `${groupId} → cascade:${msg.payload.state}`);
|
|
334
|
-
setTimeout(() => setStatus('yellow', 'ring', `${groupId} ready`), 3000);
|
|
335
331
|
}
|
|
336
332
|
} else {
|
|
337
333
|
const devReq = typeof msg.device === 'string'
|
|
@@ -349,7 +345,6 @@ module.exports = function (RED) {
|
|
|
349
345
|
pubState({ state: msg.payload.state, color_mode: S.colorMode, brightness: msg.payload.brightness });
|
|
350
346
|
forwardToChildren(msg.payload, null);
|
|
351
347
|
setStatus('green', 'dot', `${groupId} → ${msg.payload.state}`);
|
|
352
|
-
setTimeout(() => setStatus('yellow', 'ring', `${groupId} ready`), 3000);
|
|
353
348
|
} else {
|
|
354
349
|
node.warn(`${groupId} — unrecognised message received and dropped. See node documentation.`);
|
|
355
350
|
}
|
package/nodes/ha-mqtt-dmx.js
CHANGED
|
@@ -66,7 +66,7 @@ module.exports = function (RED) {
|
|
|
66
66
|
// but still respect cooldown to prevent accidental rapid-fire
|
|
67
67
|
const now = Date.now();
|
|
68
68
|
if (now - _lastDiscoveryTime < _DISCOVERY_COOLDOWN_MS) {
|
|
69
|
-
node.
|
|
69
|
+
if (S.debugMode) node.debug('Discovery cooldown active — skipping duplicate auto-discover');
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
72
|
_lastDiscoveryTime = now;
|
|
@@ -176,7 +176,20 @@ module.exports = function (RED) {
|
|
|
176
176
|
// ── Disk save timer ───────────────────────────────────────
|
|
177
177
|
let diskTimer = null;
|
|
178
178
|
function startDiskSave(onComplete) {
|
|
179
|
-
if (diskTimer) {
|
|
179
|
+
if (diskTimer) {
|
|
180
|
+
clearTimeout(diskTimer);
|
|
181
|
+
diskTimer = null;
|
|
182
|
+
// Flush pending disk save immediately on close
|
|
183
|
+
const s=ctxGet('state'); const br=ctxGet('brightness');
|
|
184
|
+
const r=ctxGet('red'); const g=ctxGet('green'); const b=ctxGet('blue');
|
|
185
|
+
const w=ctxGet('white'); const ww=ctxGet('warmWhite');
|
|
186
|
+
if (s !== undefined) {
|
|
187
|
+
ctxSet('state',s,'disk_values'); ctxSet('brightness',br,'disk_values');
|
|
188
|
+
ctxSet('red',r,'disk_values'); ctxSet('green',g,'disk_values');
|
|
189
|
+
ctxSet('blue',b,'disk_values'); ctxSet('white',w,'disk_values');
|
|
190
|
+
ctxSet('warmWhite',ww,'disk_values');
|
|
191
|
+
}
|
|
192
|
+
}
|
|
180
193
|
diskTimer = setTimeout(() => { diskTimer = null; onComplete(); }, S.diskDelay * 1000);
|
|
181
194
|
}
|
|
182
195
|
|
|
@@ -666,7 +679,20 @@ module.exports = function (RED) {
|
|
|
666
679
|
function handleDeviceRemove() {
|
|
667
680
|
clearChannelRegistry();
|
|
668
681
|
stopEffect();
|
|
669
|
-
if (diskTimer) {
|
|
682
|
+
if (diskTimer) {
|
|
683
|
+
clearTimeout(diskTimer);
|
|
684
|
+
diskTimer = null;
|
|
685
|
+
// Flush pending disk save immediately on close
|
|
686
|
+
const s=ctxGet('state'); const br=ctxGet('brightness');
|
|
687
|
+
const r=ctxGet('red'); const g=ctxGet('green'); const b=ctxGet('blue');
|
|
688
|
+
const w=ctxGet('white'); const ww=ctxGet('warmWhite');
|
|
689
|
+
if (s !== undefined) {
|
|
690
|
+
ctxSet('state',s,'disk_values'); ctxSet('brightness',br,'disk_values');
|
|
691
|
+
ctxSet('red',r,'disk_values'); ctxSet('green',g,'disk_values');
|
|
692
|
+
ctxSet('blue',b,'disk_values'); ctxSet('white',w,'disk_values');
|
|
693
|
+
ctxSet('warmWhite',ww,'disk_values');
|
|
694
|
+
}
|
|
695
|
+
}
|
|
670
696
|
['state','brightness','red','green','blue','white','warmWhite'].forEach(function (k) {
|
|
671
697
|
ctxSet(k, null); ctxSet(k, null, 'disk_values');
|
|
672
698
|
});
|
package/nodes/ha-mqtt-pir.js
CHANGED
|
@@ -56,7 +56,7 @@ module.exports = function (RED) {
|
|
|
56
56
|
// but still respect cooldown to prevent accidental rapid-fire
|
|
57
57
|
const now = Date.now();
|
|
58
58
|
if (now - _lastDiscoveryTime < _DISCOVERY_COOLDOWN_MS) {
|
|
59
|
-
node.
|
|
59
|
+
if (S.debugMode) node.debug('Discovery cooldown active — skipping duplicate auto-discover');
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
62
|
_lastDiscoveryTime = now;
|
package/nodes/ha-mqtt-relay.js
CHANGED
|
@@ -59,7 +59,7 @@ module.exports = function (RED) {
|
|
|
59
59
|
// but still respect cooldown to prevent accidental rapid-fire
|
|
60
60
|
const now = Date.now();
|
|
61
61
|
if (now - _lastDiscoveryTime < _DISCOVERY_COOLDOWN_MS) {
|
|
62
|
-
node.
|
|
62
|
+
if (S.debugMode) node.debug('Discovery cooldown active — skipping duplicate auto-discover');
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
65
|
_lastDiscoveryTime = now;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-dmx-for-ha",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.9",
|
|
4
4
|
"description": "DMX lighting control for Home Assistant via Node-RED and MQTT. Place a node, fill in the settings, deploy. Full HA device registry integration with RGBW/RGBWW/CCT/brightness colour modes, transitions, effects, and group control.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node-red",
|