node-red-contrib-dmx-for-ha 0.6.26 → 0.6.27

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.26
316
+ node-red-contrib-dmx-for-ha &nbsp;v0.6.27
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.26
320
+ node-red-contrib-dmx-for-ha &nbsp;v0.6.27
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.26
587
+ node-red-contrib-dmx-for-ha &nbsp;v0.6.27
588
588
  </div>
589
589
 
590
590
  </script>
@@ -250,6 +250,10 @@ module.exports = function (RED) {
250
250
  const _lastSent = {};
251
251
 
252
252
  function sendDmxChannels(channels) {
253
+ // Enforce DMX floor — no value between 1 and (floor-1) ever reaches controller
254
+ if (S.dmxFloor > 0) {
255
+ channels = channels.map(([ch, val]) => [ch, (val > 0 && val < S.dmxFloor) ? S.dmxFloor : val]);
256
+ }
253
257
  if (dmxProfile.batched) {
254
258
  // ── Batched mode (etherten_v2) ─────────────────────────────
255
259
  // Collect all changed channels → publish ONE message per tick
@@ -351,18 +355,11 @@ module.exports = function (RED) {
351
355
  p.warmWhite !== undefined ? p.warmWhite : 0
352
356
  );
353
357
  sendDmxChannels(channels);
354
- const br = p.brightness !== undefined ? p.brightness : 255;
355
358
  pubState({
356
359
  state: p.state || 'OFF',
357
360
  color_mode: S.colorMode,
358
361
  brightness: p.brightness,
359
- color: {
360
- r: scaleToDmx(p.red !== undefined ? p.red : 255, br),
361
- g: scaleToDmx(p.green !== undefined ? p.green : 255, br),
362
- b: scaleToDmx(p.blue !== undefined ? p.blue : 255, br),
363
- w: scaleToDmx(p.white !== undefined ? p.white : 255, br),
364
- ww: p.warmWhite
365
- }
362
+ color: { r: p.red, g: p.green, b: p.blue, w: p.white, ww: p.warmWhite }
366
363
  });
367
364
  if (p.state === 'ON') {
368
365
  setStatus('green', 'dot', `${fixtureId} ON bright:${p.brightness}`);
@@ -498,12 +495,7 @@ module.exports = function (RED) {
498
495
  }
499
496
 
500
497
  saveState('ON', brightness, r, g, b, w, ww);
501
- // Report floored DMX values back to HA so sub-floor bleed is never stored in state
502
- const rPub = scaleToDmx(r, brightness);
503
- const gPub = scaleToDmx(g, brightness);
504
- const bPub = scaleToDmx(b, brightness);
505
- const wPub = scaleToDmx(w, brightness);
506
- pubState({ state: 'ON', color_mode: S.colorMode, brightness, color: { r: rPub, g: gPub, b: bPub, w: wPub, ww } });
498
+ pubState({ state: 'ON', color_mode: S.colorMode, brightness, color: { r, g, b, w, ww } });
507
499
  setStatus('green', 'dot', `${fixtureId} ON bright:${brightness}`);
508
500
  }
509
501
 
@@ -810,12 +802,7 @@ module.exports = function (RED) {
810
802
  } else {
811
803
  sendDmxChannels(buildColorChannels(0, r, g, b, w, ww));
812
804
  }
813
- // Report floored values so HA never stores sub-floor values in state
814
- const rPub = state === 'ON' ? scaleToDmx(r, brightness) : r;
815
- const gPub = state === 'ON' ? scaleToDmx(g, brightness) : g;
816
- const bPub = state === 'ON' ? scaleToDmx(b, brightness) : b;
817
- const wPub = state === 'ON' ? scaleToDmx(w, brightness) : w;
818
- pubState({ state, color_mode: S.colorMode, brightness, color: { r: rPub, g: gPub, b: bPub, w: wPub, ww } });
805
+ pubState({ state, color_mode: S.colorMode, brightness, color: { r, g, b, w, ww } });
819
806
  if (state === 'ON') {
820
807
  setStatus('green', 'dot', `${fixtureId} ON bright:${brightness}`);
821
808
  } else {
@@ -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.26
321
+ node-red-contrib-dmx-for-ha &nbsp;v0.6.27
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.26
304
+ node-red-contrib-dmx-for-ha &nbsp;v0.6.27
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.26",
3
+ "version": "0.6.27",
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",