node-red-contrib-dmx-for-ha 0.6.23 → 0.6.25

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.
@@ -313,7 +313,7 @@
313
313
  </div>
314
314
 
315
315
  <div style="margin-top:16px; padding-top:8px; border-top:1px solid #444; color:#666; font-size:0.8em; text-align:right;">
316
- node-red-contrib-dmx-for-ha &nbsp;v0.6.23
316
+ node-red-contrib-dmx-for-ha &nbsp;v0.6.25
317
317
  </div>
318
318
 
319
319
  </script>
@@ -317,7 +317,7 @@
317
317
  </div>
318
318
 
319
319
  <div style="margin-top:16px; padding-top:8px; border-top:1px solid #444; color:#666; font-size:0.8em; text-align:right;">
320
- node-red-contrib-dmx-for-ha &nbsp;v0.6.23
320
+ node-red-contrib-dmx-for-ha &nbsp;v0.6.25
321
321
  </div>
322
322
 
323
323
  </script>
@@ -584,7 +584,7 @@
584
584
  </div>
585
585
 
586
586
  <div style="margin-top:16px; padding-top:8px; border-top:1px solid #444; color:#666; font-size:0.8em; text-align:right;">
587
- node-red-contrib-dmx-for-ha &nbsp;v0.6.23
587
+ node-red-contrib-dmx-for-ha &nbsp;v0.6.25
588
588
  </div>
589
589
 
590
590
  </script>
@@ -225,6 +225,8 @@ module.exports = function (RED) {
225
225
  // ── DMX helpers ───────────────────────────────────────────
226
226
  function scaleToDmx(colorValue, brightness) {
227
227
  brightness = brightness !== undefined ? brightness : 255;
228
+ // Hard zero — never apply any floor when brightness is 0 (OFF)
229
+ if (brightness === 0) return 0;
228
230
  const limited = Math.round((colorValue / 255) * (brightness / 255) * S.dmxLimiter);
229
231
  const gamma = GAMMA_TABLE[Math.max(0, Math.min(255, limited))];
230
232
  // Min output floor — only apply when both inputs are non-zero (intentionally on)
@@ -489,7 +491,12 @@ module.exports = function (RED) {
489
491
  }
490
492
 
491
493
  saveState('ON', brightness, r, g, b, w, ww);
492
- pubState({ state: 'ON', color_mode: S.colorMode, brightness, color: { r, g, b, w, ww } });
494
+ // Report floored DMX values back to HA so sub-floor bleed is never stored in state
495
+ const rPub = scaleToDmx(r, brightness);
496
+ const gPub = scaleToDmx(g, brightness);
497
+ const bPub = scaleToDmx(b, brightness);
498
+ const wPub = scaleToDmx(w, brightness);
499
+ pubState({ state: 'ON', color_mode: S.colorMode, brightness, color: { r: rPub, g: gPub, b: bPub, w: wPub, ww } });
493
500
  setStatus('green', 'dot', `${fixtureId} ON bright:${brightness}`);
494
501
  }
495
502
 
@@ -318,7 +318,7 @@
318
318
  </div>
319
319
 
320
320
  <div style="margin-top:16px; padding-top:8px; border-top:1px solid #444; color:#666; font-size:0.8em; text-align:right;">
321
- node-red-contrib-dmx-for-ha &nbsp;v0.6.23
321
+ node-red-contrib-dmx-for-ha &nbsp;v0.6.25
322
322
  </div>
323
323
 
324
324
  </script>
@@ -301,7 +301,7 @@
301
301
  </div>
302
302
 
303
303
  <div style="margin-top:16px; padding-top:8px; border-top:1px solid #444; color:#666; font-size:0.8em; text-align:right;">
304
- node-red-contrib-dmx-for-ha &nbsp;v0.6.23
304
+ node-red-contrib-dmx-for-ha &nbsp;v0.6.25
305
305
  </div>
306
306
 
307
307
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-dmx-for-ha",
3
- "version": "0.6.23",
3
+ "version": "0.6.25",
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",