node-red-contrib-dmx-for-ha 0.6.11 → 0.6.13
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-config.html +3 -3
- package/nodes/ha-mqtt-dmx.html +11 -0
- package/nodes/ha-mqtt-dmx.js +10 -17
- package/package.json +1 -1
|
@@ -212,12 +212,12 @@
|
|
|
212
212
|
</div>
|
|
213
213
|
<div class="form-row">
|
|
214
214
|
<label for="node-config-input-dmxFloor">
|
|
215
|
-
<i class="fa fa-arrow-
|
|
215
|
+
<i class="fa fa-arrow-down"></i> DMX Floor
|
|
216
216
|
</label>
|
|
217
217
|
<input type="number" id="node-config-input-dmxFloor"
|
|
218
|
-
min="0" max="
|
|
218
|
+
min="0" max="20" step="1" style="width:70px" />
|
|
219
219
|
<span style="margin-left:8px; color:#999; font-size:0.85em;">
|
|
220
|
-
|
|
220
|
+
Min DMX value sent — below this snaps up (0=OFF always OFF). Default: 3
|
|
221
221
|
</span>
|
|
222
222
|
</div>
|
|
223
223
|
</script>
|
package/nodes/ha-mqtt-dmx.html
CHANGED
|
@@ -169,6 +169,7 @@
|
|
|
169
169
|
defaultState: { value: 'OFF' },
|
|
170
170
|
// Advanced
|
|
171
171
|
dmxLimiter: { value: '255' },
|
|
172
|
+
minOutput: { value: '1' },
|
|
172
173
|
brightBump: { value: '50' },
|
|
173
174
|
ticksPerSec: { value: '31' },
|
|
174
175
|
debugMode: { value: false },
|
|
@@ -542,6 +543,16 @@
|
|
|
542
543
|
min="0" max="255" style="width:70px" />
|
|
543
544
|
<span style="margin-left:8px; color:#999; font-size:0.85em;">Caps all DMX channel values (0–255)</span>
|
|
544
545
|
</div>
|
|
546
|
+
|
|
547
|
+
<div class="form-row">
|
|
548
|
+
<label for="node-input-minOutput">
|
|
549
|
+
<i class="fa fa-sort-numeric-asc"></i> Min output when ON
|
|
550
|
+
</label>
|
|
551
|
+
<input type="number" id="node-input-minOutput"
|
|
552
|
+
min="0" max="255" style="width:70px" />
|
|
553
|
+
<span style="margin-left:8px; color:#999; font-size:0.85em;">0 = pure gamma</span>
|
|
554
|
+
</div>
|
|
555
|
+
|
|
545
556
|
<div class="form-row">
|
|
546
557
|
<label for="node-input-brightBump">
|
|
547
558
|
<i class="fa fa-sort-numeric-asc"></i> Brightness bump
|
package/nodes/ha-mqtt-dmx.js
CHANGED
|
@@ -132,7 +132,7 @@ module.exports = function (RED) {
|
|
|
132
132
|
groupSync: config.groupSync === true,
|
|
133
133
|
defaultState: config.defaultState || 'OFF',
|
|
134
134
|
dmxLimiter: parseInt(config.dmxLimiter) || 255,
|
|
135
|
-
|
|
135
|
+
minOutput: parseInt(config.minOutput) || 1,
|
|
136
136
|
brightBump: parseInt(config.brightBump) || 50,
|
|
137
137
|
ticksPerSec: parseInt(config.ticksPerSec) || 31,
|
|
138
138
|
debugMode: config.debugMode === true,
|
|
@@ -205,11 +205,13 @@ module.exports = function (RED) {
|
|
|
205
205
|
brightness = brightness !== undefined ? brightness : 255;
|
|
206
206
|
const limited = Math.round((colorValue / 255) * (brightness / 255) * S.dmxLimiter);
|
|
207
207
|
const gamma = GAMMA_TABLE[Math.max(0, Math.min(255, limited))];
|
|
208
|
-
//
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
208
|
+
// Min output floor — only apply when both inputs are non-zero (intentionally on)
|
|
209
|
+
if (gamma === 0 && colorValue > 0 && brightness > 0 && S.minOutput > 0) {
|
|
210
|
+
return S.minOutput;
|
|
211
|
+
}
|
|
212
|
+
// DMX floor — snap up if above 0 but below hardware stable threshold
|
|
213
|
+
if (gamma > 0 && gamma < S.dmxFloor) return S.dmxFloor;
|
|
214
|
+
// Note: ceiling is handled by S.dmxLimiter in scaleToDmx above
|
|
213
215
|
return gamma;
|
|
214
216
|
}
|
|
215
217
|
|
|
@@ -395,11 +397,7 @@ module.exports = function (RED) {
|
|
|
395
397
|
const progress = Math.min(1, tick / totalTicks);
|
|
396
398
|
const channels = fromChannels.map(function ([ch, from], i) {
|
|
397
399
|
const to = toChannels[i] ? toChannels[i][1] : 0;
|
|
398
|
-
|
|
399
|
-
// Apply floor during transition — never send flicker values
|
|
400
|
-
// Exception: if target is 0 (intentionally off) allow it to reach 0
|
|
401
|
-
const floored = (raw > 0 && raw < S.dmxFloor && to > 0) ? S.dmxFloor : raw;
|
|
402
|
-
return [ch, floored];
|
|
400
|
+
return [ch, Math.round(from + (to - from) * progress)];
|
|
403
401
|
});
|
|
404
402
|
sendDmxChannels(channels);
|
|
405
403
|
if (tick >= totalTicks) {
|
|
@@ -434,12 +432,7 @@ module.exports = function (RED) {
|
|
|
434
432
|
const r = color.r !== undefined ? color.r : recall('red', 'red_disk', 255);
|
|
435
433
|
const g = color.g !== undefined ? color.g : recall('green', 'green_disk', 255);
|
|
436
434
|
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);
|
|
435
|
+
const w = color.w !== undefined ? color.w : recall('white', 'white_disk', 255);
|
|
443
436
|
const ww = color.ww!== undefined ? color.ww: recall('warmWhite','warmWhite_disk', 0);
|
|
444
437
|
|
|
445
438
|
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.13",
|
|
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",
|