node-red-contrib-dmx-for-ha 0.6.2 → 0.6.4
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 +9 -3
- package/package.json +2 -2
package/nodes/ha-mqtt-dmx.js
CHANGED
|
@@ -207,8 +207,9 @@ 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
|
-
|
|
210
|
+
// Both colorValue AND brightness must be > 0 (light intentionally on)
|
|
211
|
+
// Exception: brightness = 0 means light is OFF — always allow 0
|
|
212
|
+
if (colorValue > 0 && brightness > 0 && gamma < S.dmxFloor) return S.dmxFloor;
|
|
212
213
|
return gamma;
|
|
213
214
|
}
|
|
214
215
|
|
|
@@ -433,7 +434,12 @@ module.exports = function (RED) {
|
|
|
433
434
|
const r = color.r !== undefined ? color.r : recall('red', 'red_disk', 255);
|
|
434
435
|
const g = color.g !== undefined ? color.g : recall('green', 'green_disk', 255);
|
|
435
436
|
const b = color.b !== undefined ? color.b : recall('blue', 'blue_disk', 255);
|
|
436
|
-
|
|
437
|
+
// If HA sent RGB colour but NO white value → colour wheel in use → white = 0
|
|
438
|
+
// If HA sent nothing at all → keep stored white value (scene/brightness change)
|
|
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);
|
|
437
443
|
const ww = color.ww!== undefined ? color.ww: recall('warmWhite','warmWhite_disk', 0);
|
|
438
444
|
|
|
439
445
|
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.4",
|
|
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",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"license": "GPL-3.0",
|
|
25
25
|
"main": "nodes/ha-mqtt-config.js",
|
|
26
26
|
"node-red": {
|
|
27
|
-
"version": "
|
|
27
|
+
"version": "0.6.4",
|
|
28
28
|
"nodes": {
|
|
29
29
|
"ha-mqtt-config": "nodes/ha-mqtt-config.js",
|
|
30
30
|
"ha-mqtt-dmx": "nodes/ha-mqtt-dmx.js",
|