node-red-contrib-dmx-for-ha 0.6.1 → 0.6.2
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 +0 -11
- package/nodes/ha-mqtt-dmx.js +10 -9
- 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-up"></i> DMX Floor
|
|
216
216
|
</label>
|
|
217
217
|
<input type="number" id="node-config-input-dmxFloor"
|
|
218
|
-
min="0" max="
|
|
218
|
+
min="0" max="50" step="1" style="width:70px" />
|
|
219
219
|
<span style="margin-left:8px; color:#999; font-size:0.85em;">
|
|
220
|
-
|
|
220
|
+
Minimum DMX value sent when light is ON. Values below floor snap up to floor. 0 = disabled. Default: 3
|
|
221
221
|
</span>
|
|
222
222
|
</div>
|
|
223
223
|
</script>
|
package/nodes/ha-mqtt-dmx.html
CHANGED
|
@@ -169,7 +169,6 @@
|
|
|
169
169
|
defaultState: { value: 'OFF' },
|
|
170
170
|
// Advanced
|
|
171
171
|
dmxLimiter: { value: '255' },
|
|
172
|
-
minOutput: { value: '1' },
|
|
173
172
|
brightBump: { value: '50' },
|
|
174
173
|
ticksPerSec: { value: '31' },
|
|
175
174
|
debugMode: { value: false },
|
|
@@ -543,16 +542,6 @@
|
|
|
543
542
|
min="0" max="255" style="width:70px" />
|
|
544
543
|
<span style="margin-left:8px; color:#999; font-size:0.85em;">Caps all DMX channel values (0–255)</span>
|
|
545
544
|
</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
|
-
|
|
556
545
|
<div class="form-row">
|
|
557
546
|
<label for="node-input-brightBump">
|
|
558
547
|
<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
|
-
minOutput
|
|
135
|
+
// minOutput removed v0.6.2 — use dmxFloor instead
|
|
136
136
|
brightBump: parseInt(config.brightBump) || 50,
|
|
137
137
|
ticksPerSec: parseInt(config.ticksPerSec) || 31,
|
|
138
138
|
debugMode: config.debugMode === true,
|
|
@@ -205,13 +205,10 @@ 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
|
-
// 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
|
|
208
|
+
// DMX floor — if source is ON but output is below floor, snap up
|
|
209
|
+
// Prevents flickering at low DMX values that decoders can't handle cleanly
|
|
210
|
+
// Exception: if colorValue is 0, light is intentionally OFF — send 0
|
|
211
|
+
if (colorValue > 0 && gamma < S.dmxFloor) return S.dmxFloor;
|
|
215
212
|
return gamma;
|
|
216
213
|
}
|
|
217
214
|
|
|
@@ -397,7 +394,11 @@ module.exports = function (RED) {
|
|
|
397
394
|
const progress = Math.min(1, tick / totalTicks);
|
|
398
395
|
const channels = fromChannels.map(function ([ch, from], i) {
|
|
399
396
|
const to = toChannels[i] ? toChannels[i][1] : 0;
|
|
400
|
-
|
|
397
|
+
const raw = Math.round(from + (to - from) * progress);
|
|
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];
|
|
401
402
|
});
|
|
402
403
|
sendDmxChannels(channels);
|
|
403
404
|
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.2",
|
|
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",
|