node-red-contrib-knx-ultimate 2.4.7 → 2.4.9
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/CHANGELOG.md +1 -1
- package/nodes/knxUltimateHueLight.js +23 -13
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# CHANGELOG
|
|
8
8
|
|
|
9
|
-
**Version 2.4.
|
|
9
|
+
**Version 2.4.9** - March 2024<br/>
|
|
10
10
|
- WARNING: this version uses the Node-Red plugin system; the Node-Red version must be **equals or major than 3.1.1**<br/>
|
|
11
11
|
- Fixed [this](https://github.com/Supergiovane/node-red-contrib-knx-ultimate/issues/338).<br/>
|
|
12
12
|
|
|
@@ -209,9 +209,10 @@ module.exports = function (RED) {
|
|
|
209
209
|
const dretXY = hueColorConverter.ColorConverter.calculateXYFromRGB(colorChoosen.red, colorChoosen.green, colorChoosen.blue, gamut);
|
|
210
210
|
const dbright = hueColorConverter.ColorConverter.getBrightnessFromRGBOrHex(colorChoosen.red, colorChoosen.green, colorChoosen.blue);
|
|
211
211
|
node.currentHUEDevice.dimming.brightness = Math.round(dbright, 0);
|
|
212
|
+
if (node.currentHUEDevice.color !== undefined) node.currentHUEDevice.color.xy = dretXY; // 26/03/2024
|
|
212
213
|
node.updateKNXBrightnessState(node.currentHUEDevice.dimming.brightness);
|
|
213
|
-
|
|
214
|
-
state = { on: { on: true }, dimming: { brightness: dbright }, color: { xy: dretXY } };
|
|
214
|
+
state = dbright > 0 ? { on: { on: true }, dimming: { brightness: dbright }, color: { xy: dretXY } } : { on: { on: false } };
|
|
215
|
+
// state = { on: { on: true }, dimming: { brightness: dbright }, color: { xy: dretXY } };
|
|
215
216
|
} else if (temperatureChoosen !== undefined) {
|
|
216
217
|
// Kelvin
|
|
217
218
|
const mirek = hueColorConverter.ColorConverter.kelvinToMirek(temperatureChoosen);
|
|
@@ -219,11 +220,11 @@ module.exports = function (RED) {
|
|
|
219
220
|
node.currentHUEDevice.dimming.brightness = brightnessChoosen;
|
|
220
221
|
node.updateKNXBrightnessState(node.currentHUEDevice.dimming.brightness);
|
|
221
222
|
// Kelvin temp
|
|
222
|
-
|
|
223
|
-
state = { on: { on: true }, dimming: { brightness: brightnessChoosen }, color_temperature: { mirek: mirek } };
|
|
223
|
+
state = brightnessChoosen > 0 ? { on: { on: true }, dimming: { brightness: brightnessChoosen }, color_temperature: { mirek: mirek } } : { on: { on: false } };
|
|
224
|
+
// state = { on: { on: true }, dimming: { brightness: brightnessChoosen }, color_temperature: { mirek: mirek } };
|
|
224
225
|
} else if (brightnessChoosen !== undefined) {
|
|
225
|
-
|
|
226
|
-
state = { on: { on: true }, dimming: { brightness: brightnessChoosen } };
|
|
226
|
+
state = brightnessChoosen > 0 ? { on: { on: true }, dimming: { brightness: brightnessChoosen } } : { on: { on: false } };
|
|
227
|
+
// state = { on: { on: true }, dimming: { brightness: brightnessChoosen } };
|
|
227
228
|
} else {
|
|
228
229
|
state = { on: { on: true } };
|
|
229
230
|
}
|
|
@@ -307,7 +308,7 @@ module.exports = function (RED) {
|
|
|
307
308
|
try {
|
|
308
309
|
const retLights = await node.serverHue.getAllLightsBelongingToTheGroup(node.hueDevice);
|
|
309
310
|
node.HUELightsBelongingToGroupWhileDaytime = cloneDeep(retLights); // DayTime has switched to false: save the lights belonging to the group into the HUELightsBelongingToGroupWhileDaytime array
|
|
310
|
-
} catch (error) { }
|
|
311
|
+
} catch (error) { /* empty */ }
|
|
311
312
|
})();
|
|
312
313
|
}
|
|
313
314
|
}
|
|
@@ -530,6 +531,7 @@ module.exports = function (RED) {
|
|
|
530
531
|
try {
|
|
531
532
|
let hueTelegram = {};
|
|
532
533
|
let numStep = 10; // Steps from 0 to 100 by 10
|
|
534
|
+
const extendedConf = {};
|
|
533
535
|
|
|
534
536
|
if (_KNXbrightness_Direction === 0 && _KNXaction === 0) {
|
|
535
537
|
// STOP DIM
|
|
@@ -539,6 +541,12 @@ module.exports = function (RED) {
|
|
|
539
541
|
return;
|
|
540
542
|
}
|
|
541
543
|
|
|
544
|
+
// 26/03/2024 set the extended configuration as well, because the light was off (so i've been unable to set it up elsewhere)
|
|
545
|
+
if (node.currentHUEDevice.on !== undefined && node.currentHUEDevice.on.on === false) {
|
|
546
|
+
// if (node.currentHUEDevice.color !== undefined) extendedConf.color = { xy: node.currentHUEDevice.color.xy }; // DO NOT ADD THE COLOR, BECAUSE THE COLOR HAS ALSO THE BRIGHTNESS, SO ALL THE DATA NEEDED TO BE SWITCHED ON CORRECLY
|
|
547
|
+
if (node.currentHUEDevice.color_temperature !== undefined) extendedConf.color_temperature = { mirek: node.currentHUEDevice.color_temperature.mirek };
|
|
548
|
+
}
|
|
549
|
+
|
|
542
550
|
// If i'm dimming up while the light is off, start the dim with the initial brightness set to zero
|
|
543
551
|
if (_KNXbrightness_Direction > 0 && _KNXaction === 1 && node.currentHUEDevice.on !== undefined && node.currentHUEDevice.on.on === false) {
|
|
544
552
|
node.brightnessStep = null;
|
|
@@ -575,7 +583,9 @@ module.exports = function (RED) {
|
|
|
575
583
|
// Switch on the light if off
|
|
576
584
|
if (node.currentHUEDevice.on !== undefined && node.currentHUEDevice.on.on === false) {
|
|
577
585
|
hueTelegram.on = { on: true };
|
|
586
|
+
Object.assign(hueTelegram, extendedConf); // 26/03/2024 add extended conf
|
|
578
587
|
}
|
|
588
|
+
//console.log(hueTelegram)
|
|
579
589
|
node.serverHue.hueManager.writeHueQueueAdd(node.hueDevice, hueTelegram, node.isGrouped_light === false ? "setLight" : "setGroupedLight");
|
|
580
590
|
if (node.brightnessStep >= maxDimLevelLight) clearInterval(node.timerStepDim);
|
|
581
591
|
}, _dimSpeedInMillisecs);
|
|
@@ -851,7 +861,7 @@ module.exports = function (RED) {
|
|
|
851
861
|
|
|
852
862
|
node.handleSendHUE = (_event) => {
|
|
853
863
|
try {
|
|
854
|
-
|
|
864
|
+
const deviceByRef = cloneDeep(_event);
|
|
855
865
|
if (deviceByRef.id === node.hueDevice) {
|
|
856
866
|
if (node.currentHUEDevice === undefined || node.serverHue === null || node.serverHue === undefined) {
|
|
857
867
|
node.setNodeStatusHue({
|
|
@@ -1107,11 +1117,11 @@ module.exports = function (RED) {
|
|
|
1107
1117
|
// };
|
|
1108
1118
|
|
|
1109
1119
|
/**
|
|
1110
|
-
* Update the KNC colors and HSV states group addresses
|
|
1111
|
-
* @param {object} _value {xy:{x,y}} in 0-1 scale
|
|
1112
|
-
* @param {string} _outputtype "write" is the default KNX command
|
|
1113
|
-
* @returns {}
|
|
1114
|
-
*/
|
|
1120
|
+
* Update the KNC colors and HSV states group addresses
|
|
1121
|
+
* @param {object} _value {xy:{x,y}} in 0-1 scale
|
|
1122
|
+
* @param {string} _outputtype "write" is the default KNX command
|
|
1123
|
+
* @returns {}
|
|
1124
|
+
*/
|
|
1115
1125
|
node.updateKNXLightColorState = function updateKNXLightColorState(_value, _outputtype = "write") {
|
|
1116
1126
|
if (config.GALightColorState !== undefined && config.GALightColorState !== "") {
|
|
1117
1127
|
if (_value.xy === undefined || _value.xy.x === undefined) return;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"engines": {
|
|
4
4
|
"node": ">=16.0.0"
|
|
5
5
|
},
|
|
6
|
-
"version": "2.4.
|
|
6
|
+
"version": "2.4.9",
|
|
7
7
|
"description": "Control your KNX intallation via Node-Red! A bunch of KNX nodes, with integrated Philips HUE control and ETS group address importer. Easy to use and highly configurable.",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"binary-parser": "2.2.1",
|