node-red-contrib-knx-ultimate 2.2.19 → 2.2.21
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 +877 -887
- package/nodes/hue-config.js +25 -5
- package/nodes/knxUltimateHueBattery.html +2 -1
- package/nodes/knxUltimateHueButton.html +2 -1
- package/nodes/knxUltimateHueLight.html +632 -544
- package/nodes/knxUltimateHueLight.js +84 -50
- package/nodes/knxUltimateHueLightSensor.html +3 -1
- package/nodes/knxUltimateHueMotion.html +2 -1
- package/nodes/knxUltimateHueScene.html +2 -1
- package/nodes/knxUltimateHueTapDial.html +2 -1
- package/nodes/knxUltimateHueTemperatureSensor.html +2 -1
- package/nodes/utils/hueColorConverter.js +195 -36
- package/package.json +1 -2
- package/resources/iro@5 +0 -7
package/nodes/hue-config.js
CHANGED
|
@@ -319,14 +319,26 @@ module.exports = (RED) => {
|
|
|
319
319
|
}
|
|
320
320
|
};
|
|
321
321
|
|
|
322
|
-
//
|
|
322
|
+
// Get current color in HEX (used in html)
|
|
323
323
|
node.getColorFromHueLight = (_lightId) => {
|
|
324
324
|
try {
|
|
325
325
|
const oLight = node.hueAllResources.filter((a) => a.id === _lightId)[0];
|
|
326
|
-
const
|
|
326
|
+
const retRGB = hueColorConverter.ColorConverter.xyBriToRgb(oLight.color.xy.x, oLight.color.xy.y, oLight.dimming.brightness);
|
|
327
|
+
const ret = "#" + hueColorConverter.ColorConverter.rgbHex(retRGB.r, retRGB.g, retRGB.b).toString();
|
|
328
|
+
return ret;
|
|
329
|
+
} catch (error) {
|
|
330
|
+
if (node.sysLogger !== undefined && node.sysLogger !== null) node.sysLogger.warn(`KNXUltimateHue: hueEngine: getColorFromHueLight: error ${error.message}`);
|
|
331
|
+
return {};
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
// Get current Kelvin (used in html)
|
|
335
|
+
node.getKelvinFromHueLight = (_lightId) => {
|
|
336
|
+
try {
|
|
337
|
+
const oLight = node.hueAllResources.filter((a) => a.id === _lightId)[0];
|
|
338
|
+
const ret = { kelvin: hueColorConverter.ColorConverter.mirekToKelvin(oLight.color_temperature.mirek), brightness: Math.round(oLight.dimming.brightness, 0) };
|
|
327
339
|
return JSON.stringify(ret);
|
|
328
340
|
} catch (error) {
|
|
329
|
-
if (node.sysLogger !== undefined && node.sysLogger !== null) node.sysLogger.error(`KNXUltimateHue: hueEngine:
|
|
341
|
+
if (node.sysLogger !== undefined && node.sysLogger !== null) node.sysLogger.error(`KNXUltimateHue: hueEngine: getKelvinFromHueLight: error ${error.message}`);
|
|
330
342
|
return {};
|
|
331
343
|
}
|
|
332
344
|
};
|
|
@@ -391,8 +403,16 @@ module.exports = (RED) => {
|
|
|
391
403
|
|
|
392
404
|
RED.httpAdmin.get("/knxUltimateGetHueColor", RED.auth.needsPermission("hue-config.read"), (req, res) => {
|
|
393
405
|
try {
|
|
394
|
-
const
|
|
395
|
-
res.json(
|
|
406
|
+
const hexColor = node.getColorFromHueLight(req.query.id);
|
|
407
|
+
res.json(hexColor);
|
|
408
|
+
} catch (error) {
|
|
409
|
+
res.json("Select the device first!");
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
RED.httpAdmin.get("/knxUltimateGetKelvinColor", RED.auth.needsPermission("hue-config.read"), (req, res) => {
|
|
413
|
+
try {
|
|
414
|
+
const jKelvin = node.getKelvinFromHueLight(req.query.id);
|
|
415
|
+
res.json(jKelvin);
|
|
396
416
|
} catch (error) {
|
|
397
417
|
res.json("Select the device first!");
|
|
398
418
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
<script type="text/javascript" src="resources/node-red-contrib-knx-ultimate/11f26b4500.js"></script>
|
|
2
|
+
|
|
1
3
|
<script type="text/javascript">
|
|
2
4
|
RED.nodes.registerType('knxUltimateHueBattery', {
|
|
3
5
|
category: "KNX Ultimate",
|
|
@@ -227,7 +229,6 @@
|
|
|
227
229
|
|
|
228
230
|
|
|
229
231
|
</script>
|
|
230
|
-
<script src="resources/node-red-contrib-knx-ultimate/11f26b4500.js"></script>
|
|
231
232
|
|
|
232
233
|
<script type="text/markdown" data-help-name="knxUltimateHueBattery">
|
|
233
234
|
This node lets you get the battery level from your HUE device. Here you can get the HUE battery level events, that represents a percentage 0-100% value, evetytime the
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
<script type="text/javascript" src="resources/node-red-contrib-knx-ultimate/11f26b4500.js"></script>
|
|
2
|
+
|
|
1
3
|
<script type="text/javascript">
|
|
2
4
|
RED.nodes.registerType('knxUltimateHueButton', {
|
|
3
5
|
category: "KNX Ultimate",
|
|
@@ -404,7 +406,6 @@
|
|
|
404
406
|
|
|
405
407
|
|
|
406
408
|
</script>
|
|
407
|
-
<script src="resources/node-red-contrib-knx-ultimate/11f26b4500.js"></script>
|
|
408
409
|
|
|
409
410
|
<script type="text/markdown" data-help-name="knxUltimateHueButton">
|
|
410
411
|
This node lets you get the events from your HUE button.
|