node-red-contrib-dmx-for-ha 0.6.11 → 0.6.12
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-dmx.js +5 -11
- package/package.json +1 -1
package/nodes/ha-mqtt-dmx.js
CHANGED
|
@@ -207,9 +207,8 @@ module.exports = function (RED) {
|
|
|
207
207
|
const gamma = GAMMA_TABLE[Math.max(0, Math.min(255, limited))];
|
|
208
208
|
// DMX floor — if source is ON but output is below floor, snap up
|
|
209
209
|
// Prevents flickering at low DMX values that decoders can't handle cleanly
|
|
210
|
-
//
|
|
211
|
-
|
|
212
|
-
if (colorValue > 0 && brightness > 0 && gamma < S.dmxFloor) return S.dmxFloor;
|
|
210
|
+
// Exception: if colorValue is 0, light is intentionally OFF — send 0
|
|
211
|
+
if (colorValue > 0 && gamma < S.dmxFloor) return S.dmxFloor;
|
|
213
212
|
return gamma;
|
|
214
213
|
}
|
|
215
214
|
|
|
@@ -397,8 +396,8 @@ module.exports = function (RED) {
|
|
|
397
396
|
const to = toChannels[i] ? toChannels[i][1] : 0;
|
|
398
397
|
const raw = Math.round(from + (to - from) * progress);
|
|
399
398
|
// Apply floor during transition — never send flicker values
|
|
400
|
-
// Exception: if target is 0 (intentionally off)
|
|
401
|
-
const floored = (raw > 0 && raw < S.dmxFloor
|
|
399
|
+
// Exception: if target is 0, allow 0 (light intentionally off)
|
|
400
|
+
const floored = (raw > 0 && raw < S.dmxFloor) ? S.dmxFloor : raw;
|
|
402
401
|
return [ch, floored];
|
|
403
402
|
});
|
|
404
403
|
sendDmxChannels(channels);
|
|
@@ -434,12 +433,7 @@ module.exports = function (RED) {
|
|
|
434
433
|
const r = color.r !== undefined ? color.r : recall('red', 'red_disk', 255);
|
|
435
434
|
const g = color.g !== undefined ? color.g : recall('green', 'green_disk', 255);
|
|
436
435
|
const b = color.b !== undefined ? color.b : recall('blue', 'blue_disk', 255);
|
|
437
|
-
|
|
438
|
-
// If no colour sent at all (brightness/scene cmd) — keep stored white value
|
|
439
|
-
const w = color.w !== undefined ? color.w
|
|
440
|
-
: (color.r !== undefined || color.g !== undefined || color.b !== undefined)
|
|
441
|
-
? 0
|
|
442
|
-
: recall('white', 'white_disk', 255);
|
|
436
|
+
const w = color.w !== undefined ? color.w : recall('white', 'white_disk', 255);
|
|
443
437
|
const ww = color.ww!== undefined ? color.ww: recall('warmWhite','warmWhite_disk', 0);
|
|
444
438
|
|
|
445
439
|
const toChannels = buildColorChannels(brightness, r, g, b, w, ww);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-dmx-for-ha",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.12",
|
|
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",
|