node-red-contrib-dmx-for-ha 0.6.17 → 0.6.19

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.
@@ -22,6 +22,7 @@ module.exports = function (RED) {
22
22
  if (!broker) { node.error('Button: no MQTT broker in config'); return; }
23
23
 
24
24
  broker.register(node);
25
+ if (broker.client && broker.client.setMaxListeners) broker.client.setMaxListeners(0);
25
26
 
26
27
  // ── Auto-discovery based on Discovery Mode ────────────────────
27
28
  const discoveryMode = config.discoveryMode || 'enabled';
@@ -315,6 +316,7 @@ module.exports = function (RED) {
315
316
 
316
317
  // ── Cleanup ───────────────────────────────────────────────
317
318
  node.on('close', function (done) {
319
+ unregisterFixtureId();
318
320
  broker.unsubscribe(S._activeBtnTopic || S.subscribeTopic, node.id);
319
321
  broker.unsubscribe(uiBtnCmdTopic, node.id);
320
322
  broker.deregister(node, done);
@@ -25,6 +25,7 @@ module.exports = function (RED) {
25
25
  if (!broker) { node.error('DMX Group: no MQTT broker in config'); return; }
26
26
 
27
27
  broker.register(node);
28
+ if (broker.client && broker.client.setMaxListeners) broker.client.setMaxListeners(0);
28
29
 
29
30
  // ── Auto-discovery based on Discovery Mode ────────────────────
30
31
  const discoveryMode = config.discoveryMode || 'enabled';
@@ -417,6 +418,7 @@ module.exports = function (RED) {
417
418
 
418
419
  // ── Cleanup ───────────────────────────────────────────────
419
420
  node.on('close', function (done) {
421
+ unregisterFixtureId();
420
422
  if (diskTimer) clearTimeout(diskTimer);
421
423
  broker.unsubscribe(cmdTopic, node.id);
422
424
  broker.deregister(node, done);
@@ -32,6 +32,7 @@ module.exports = function (RED) {
32
32
  if (!broker) { node.error('DMX: no MQTT broker in config'); return; }
33
33
 
34
34
  broker.register(node);
35
+ if (broker.client && broker.client.setMaxListeners) broker.client.setMaxListeners(0);
35
36
 
36
37
  // ── Auto-discovery based on Discovery Mode ────────────────────
37
38
  const discoveryMode = config.discoveryMode || 'enabled';
@@ -225,6 +226,8 @@ module.exports = function (RED) {
225
226
  // ── DMX helpers ───────────────────────────────────────────
226
227
  function scaleToDmx(colorValue, brightness) {
227
228
  brightness = brightness !== undefined ? brightness : 255;
229
+ // Hard zero — never apply any floor when brightness is 0 (OFF)
230
+ if (brightness === 0) return 0;
228
231
  const limited = Math.round((colorValue / 255) * (brightness / 255) * S.dmxLimiter);
229
232
  const gamma = GAMMA_TABLE[Math.max(0, Math.min(255, limited))];
230
233
  // Min output floor — only apply when both inputs are non-zero (intentionally on)
@@ -864,6 +867,7 @@ module.exports = function (RED) {
864
867
 
865
868
  // ── Cleanup ───────────────────────────────────────────────
866
869
  node.on('close', function (done) {
870
+ unregisterFixtureId();
867
871
  clearChannelRegistry();
868
872
  stopEffect();
869
873
  if (diskTimer) clearTimeout(diskTimer);
@@ -22,6 +22,7 @@ module.exports = function (RED) {
22
22
  if (!broker) { node.error('PIR: no MQTT broker in config'); return; }
23
23
 
24
24
  broker.register(node);
25
+ if (broker.client && broker.client.setMaxListeners) broker.client.setMaxListeners(0);
25
26
 
26
27
  // ── Auto-discovery based on Discovery Mode ────────────────────
27
28
  const discoveryMode = config.discoveryMode || 'enabled';
@@ -349,6 +350,7 @@ module.exports = function (RED) {
349
350
 
350
351
  // ── Cleanup ───────────────────────────────────────────────
351
352
  node.on('close', function (done) {
353
+ unregisterFixtureId();
352
354
  cancelWarmup();
353
355
  broker.unsubscribe(S._activePirTopic || S.subscribeTopic, node.id);
354
356
  broker.deregister(node, done);
@@ -25,6 +25,7 @@ module.exports = function (RED) {
25
25
  if (!broker) { node.error('Relay: no MQTT broker in config'); return; }
26
26
 
27
27
  broker.register(node);
28
+ if (broker.client && broker.client.setMaxListeners) broker.client.setMaxListeners(0);
28
29
 
29
30
  // ── Auto-discovery based on Discovery Mode ────────────────────
30
31
  const discoveryMode = config.discoveryMode || 'enabled';
@@ -453,6 +454,7 @@ module.exports = function (RED) {
453
454
 
454
455
  // ── Cleanup ───────────────────────────────────────────────
455
456
  node.on('close', function (done) {
457
+ unregisterFixtureId();
456
458
  stopEffect();
457
459
  if (diskTimer) clearTimeout(diskTimer);
458
460
  broker.unsubscribe(cmdTopic, node.id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-dmx-for-ha",
3
- "version": "0.6.17",
3
+ "version": "0.6.19",
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",