node-red-contrib-knx-ultimate 2.2.23 → 2.2.24

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 CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  # CHANGELOG
8
8
 
9
- **Version 2.2.23** - November 2023<br/>
9
+ **Version 2.2.24** - November 2023<br/>
10
10
  - HUE Light: added DPT 9.002 for direct kelvin selection, with HUE range (2000K-6535K). There is another DPT 7.600 with the KNX scale (0K-6553K) avaiable.<br/>
11
11
  - NEW: HUE Light: now you can choose the "switch on" behaviour between color and temperature (in Kelvin) + brightness.<br/>
12
12
  - The fontawesome JS is now locally referenced.<br/>
@@ -73,11 +73,11 @@
73
73
  GALightKelvinState: { value: "" },
74
74
  dptLightKelvinState: { value: "" },
75
75
 
76
- specifySwitchOnBrightness: { value: "yes" },
77
- colorAtSwitchOnDayTime: { value: '{"red":255, "green":200, "blue":180}' },
76
+ specifySwitchOnBrightness: { value: "temperature" },
77
+ colorAtSwitchOnDayTime: { value: '{"kelvin":3000, "brightness":100 }' },
78
78
 
79
79
  enableDayNightLighting: { value: "no" },
80
- colorAtSwitchOnNightTime: { value: '{"red":23, "green":4, "blue":0}' },
80
+ colorAtSwitchOnNightTime: { value: '{ "kelvin":2700, "brightness":20 }' },
81
81
 
82
82
  invertDayNight: { value: false },
83
83
 
@@ -454,6 +454,8 @@
454
454
 
455
455
  // Calculate kelvin/color
456
456
  let json;
457
+ this.colorAtSwitchOnDayTime = this.colorAtSwitchOnDayTime.replace("geen", "green"); // Old bug in "geen" property
458
+ this.colorAtSwitchOnNightTime = this.colorAtSwitchOnNightTime.replace("geen", "green"); // Old bug in "geen" property
457
459
  try {
458
460
  json = JSON.parse(this.colorAtSwitchOnDayTime);
459
461
  } catch (error) { }
@@ -461,13 +463,19 @@
461
463
  // Kelvin
462
464
  $("#comboTemperatureAtSwitchOn").val(json.kelvin);
463
465
  $("#comboBrightnessAtSwitchOn").val(json.brightness);
466
+ if (this.specifySwitchOnBrightness !== 'no') $("#node-input-specifySwitchOnBrightness").val('temperature'); // Adjust in case of mismatch (from old geen bug)
464
467
  } else if (json !== undefined && json.red !== undefined) {
465
468
  // Must transform RGB into HTML HEX color
466
- $("#node-input-colorAtSwitchOnDayTime").val("#" + rgbHex(json.red, json.green, json.blue));
469
+ try {
470
+ $("#node-input-colorAtSwitchOnDayTime").val("#" + rgbHex(json.red, json.green, json.blue));
471
+ } catch (error) {
472
+ }
467
473
  $("#colorPickerDay").val($("#node-input-colorAtSwitchOnDayTime").val());
474
+ if (this.specifySwitchOnBrightness !== 'no') $("#node-input-specifySwitchOnBrightness").val('yes'); // Adjust in case of mismatch (from old geen bug)
468
475
  } else {
469
476
  // It's already an HEX color
470
477
  $("#colorPickerDay").val(this.colorAtSwitchOnDayTime);
478
+ if (this.specifySwitchOnBrightness !== 'no') $("#node-input-specifySwitchOnBrightness").val('yes'); // Adjust in case of mismatch (from old geen bug)
471
479
  }
472
480
  //Night
473
481
  json = undefined;
@@ -478,15 +486,22 @@
478
486
  // Kelvin
479
487
  $("#comboTemperatureAtSwitchOnNightTime").val(json.kelvin);
480
488
  $("#comboBrightnessAtSwitchOnNightTime").val(json.brightness);
489
+ if (this.enableDayNightLighting !== 'no') $("#node-input-enableDayNightLighting").val('temperature'); // Adjust in case of mismatch (from old geen bug)
481
490
  } else if (json !== undefined && json.red !== undefined) {
482
491
  // Must transform RGB into HTML HEX color
483
- $("#node-input-colorAtSwitchOnNightTime").val("#" + rgbHex(json.red, json.green, json.blue));
492
+ try {
493
+ $("#node-input-colorAtSwitchOnNightTime").val("#" + rgbHex(json.red, json.green, json.blue));
494
+ } catch (error) {
495
+ }
484
496
  $("#colorPickerNight").val($("#node-input-colorAtSwitchOnNightTime").val());
497
+ if (this.enableDayNightLighting !== 'no') $("#node-input-enableDayNightLighting").val('yes'); // Adjust in case of mismatch (from old geen bug)
485
498
  } else {
486
499
  // It's already an HEX color
487
500
  $("#colorPickerNight").val(this.colorAtSwitchOnNightTime);
501
+ if (this.enableDayNightLighting !== 'no') $("#node-input-enableDayNightLighting").val('yes'); // Adjust in case of mismatch (from old geen bug)
488
502
  }
489
503
 
504
+
490
505
  $("#comboTemperatureAtSwitchOn, #comboBrightnessAtSwitchOn").on("change", function () {
491
506
  $("#node-input-colorAtSwitchOnDayTime").val('{ "kelvin":' + $("#comboTemperatureAtSwitchOn").val() + ', "brightness":' + $("#comboBrightnessAtSwitchOn").val() + ' }');
492
507
  });
@@ -39,7 +39,8 @@ module.exports = function (RED) {
39
39
  config.specifySwitchOnBrightnessNightTime = (config.specifySwitchOnBrightnessNightTime === undefined || config.specifySwitchOnBrightnessNightTime === '') ? "no" : config.specifySwitchOnBrightnessNightTime;
40
40
  config.colorAtSwitchOnDayTime = (config.colorAtSwitchOnDayTime === '' || config.colorAtSwitchOnDayTime === undefined) ? '{ "kelvin":3000, "brightness":100 }' : config.colorAtSwitchOnDayTime;
41
41
  config.colorAtSwitchOnNightTime = (config.colorAtSwitchOnNightTime === '' || config.colorAtSwitchOnNightTime === undefined) ? '{ "kelvin":2700, "brightness":20 }' : config.colorAtSwitchOnNightTime;
42
-
42
+ config.colorAtSwitchOnDayTime = config.colorAtSwitchOnDayTime.replace("geen", "green");
43
+ config.colorAtSwitchOnNightTime = config.colorAtSwitchOnNightTime.replace("geen", "green");
43
44
  // Transform HEX in RGB and stringified json in json oblects.
44
45
  if (config.colorAtSwitchOnDayTime.indexOf("#") !== -1) {
45
46
  // Transform to rgb.
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "engines": {
4
4
  "node": ">=16.0.0"
5
5
  },
6
- "version": "2.2.23",
6
+ "version": "2.2.24",
7
7
  "description": "Control your KNX intallation via Node-Red! Single Node KNX IN/OUT with optional ETS group address importer. Easy to use and highly configurable. With integrated Philips HUE devices control.",
8
8
  "dependencies": {
9
9
  "binary-parser": "2.2.1",