node-red-contrib-dmx-for-ha 0.6.12 → 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 +9 -10
- 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,10 +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
|
-
|
|
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
|
|
212
215
|
return gamma;
|
|
213
216
|
}
|
|
214
217
|
|
|
@@ -394,11 +397,7 @@ module.exports = function (RED) {
|
|
|
394
397
|
const progress = Math.min(1, tick / totalTicks);
|
|
395
398
|
const channels = fromChannels.map(function ([ch, from], i) {
|
|
396
399
|
const to = toChannels[i] ? toChannels[i][1] : 0;
|
|
397
|
-
|
|
398
|
-
// Apply floor during transition — never send flicker values
|
|
399
|
-
// Exception: if target is 0, allow 0 (light intentionally off)
|
|
400
|
-
const floored = (raw > 0 && raw < S.dmxFloor) ? S.dmxFloor : raw;
|
|
401
|
-
return [ch, floored];
|
|
400
|
+
return [ch, Math.round(from + (to - from) * progress)];
|
|
402
401
|
});
|
|
403
402
|
sendDmxChannels(channels);
|
|
404
403
|
if (tick >= totalTicks) {
|
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",
|