node-red-contrib-knx-ultimate 1.4.18 → 2.0.1

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.
Files changed (89) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/KNXEngine/dptlib/index.js +1 -1
  3. package/KNXUltimate.code-workspace +11 -1
  4. package/README.md +3 -5
  5. package/img/hue.png +0 -0
  6. package/img/huehub.jpg +0 -0
  7. package/img/knx.png +0 -0
  8. package/nodes/hue-config.html +132 -0
  9. package/nodes/hue-config.js +150 -0
  10. package/nodes/icons/node-hue-icon.svg +10 -0
  11. package/nodes/knxUltimate-config.js +114 -40
  12. package/nodes/knxUltimateAlerter.js +3 -3
  13. package/nodes/knxUltimateGlobalContext.html +1 -1
  14. package/nodes/knxUltimateHueLight.html +597 -0
  15. package/nodes/knxUltimateHueLight.js +155 -0
  16. package/nodes/knxUltimateLoadControl.js +3 -4
  17. package/nodes/locales/de-disabled/hue-config.html +11 -0
  18. package/nodes/locales/de-disabled/hue-config.json +11 -0
  19. package/nodes/locales/de-disabled/knxUltimateHueLight.html +10 -0
  20. package/nodes/locales/de-disabled/knxUltimateHueLight.json +14 -0
  21. package/nodes/locales/en-US/hue-config.html +11 -0
  22. package/nodes/locales/en-US/hue-config.json +11 -0
  23. package/nodes/locales/en-US/knxUltimateHueLight.html +10 -0
  24. package/nodes/locales/en-US/knxUltimateHueLight.json +14 -0
  25. package/nodes/locales/it-disabled/hue-config.html +11 -0
  26. package/nodes/locales/it-disabled/hue-config.json +11 -0
  27. package/nodes/locales/it-disabled/knxUltimateHueLight.html +10 -0
  28. package/nodes/locales/it-disabled/knxUltimateHueLight.json +14 -0
  29. package/nodes/locales/zh-CN-disabled/hue-config.html +11 -0
  30. package/nodes/locales/zh-CN-disabled/hue-config.json +11 -0
  31. package/nodes/locales/zh-CN-disabled/knxUltimateHueLight.html +10 -0
  32. package/nodes/locales/zh-CN-disabled/knxUltimateHueLight.json +14 -0
  33. package/nodes/utils/hueColorConverter.js +237 -0
  34. package/nodes/utils/hueUtils.js +110 -0
  35. package/package.json +10 -5
  36. /package/nodes/locales/{de → de-disabled}/knxUltimate-config.html +0 -0
  37. /package/nodes/locales/{de → de-disabled}/knxUltimate-config.json +0 -0
  38. /package/nodes/locales/{de → de-disabled}/knxUltimate.html +0 -0
  39. /package/nodes/locales/{de → de-disabled}/knxUltimate.json +0 -0
  40. /package/nodes/locales/{de → de-disabled}/knxUltimateAlerter.html +0 -0
  41. /package/nodes/locales/{de → de-disabled}/knxUltimateAlerter.json +0 -0
  42. /package/nodes/locales/{de → de-disabled}/knxUltimateGlobalContext.html +0 -0
  43. /package/nodes/locales/{de → de-disabled}/knxUltimateGlobalContext.json +0 -0
  44. /package/nodes/locales/{de → de-disabled}/knxUltimateLoadControl.html +0 -0
  45. /package/nodes/locales/{de → de-disabled}/knxUltimateLoadControl.json +0 -0
  46. /package/nodes/locales/{de → de-disabled}/knxUltimateLogger.html +0 -0
  47. /package/nodes/locales/{de → de-disabled}/knxUltimateLogger.json +0 -0
  48. /package/nodes/locales/{de → de-disabled}/knxUltimateSceneController.html +0 -0
  49. /package/nodes/locales/{de → de-disabled}/knxUltimateSceneController.json +0 -0
  50. /package/nodes/locales/{de → de-disabled}/knxUltimateViewer.html +0 -0
  51. /package/nodes/locales/{de → de-disabled}/knxUltimateViewer.json +0 -0
  52. /package/nodes/locales/{de → de-disabled}/knxUltimateWatchDog.html +0 -0
  53. /package/nodes/locales/{de → de-disabled}/knxUltimateWatchDog.json +0 -0
  54. /package/nodes/locales/{it → it-disabled}/knxUltimate-config.html +0 -0
  55. /package/nodes/locales/{it → it-disabled}/knxUltimate-config.json +0 -0
  56. /package/nodes/locales/{it → it-disabled}/knxUltimate.html +0 -0
  57. /package/nodes/locales/{it → it-disabled}/knxUltimate.json +0 -0
  58. /package/nodes/locales/{it → it-disabled}/knxUltimateAlerter.html +0 -0
  59. /package/nodes/locales/{it → it-disabled}/knxUltimateAlerter.json +0 -0
  60. /package/nodes/locales/{it → it-disabled}/knxUltimateGlobalContext.html +0 -0
  61. /package/nodes/locales/{it → it-disabled}/knxUltimateGlobalContext.json +0 -0
  62. /package/nodes/locales/{it → it-disabled}/knxUltimateLoadControl.html +0 -0
  63. /package/nodes/locales/{it → it-disabled}/knxUltimateLoadControl.json +0 -0
  64. /package/nodes/locales/{it → it-disabled}/knxUltimateLogger.html +0 -0
  65. /package/nodes/locales/{it → it-disabled}/knxUltimateLogger.json +0 -0
  66. /package/nodes/locales/{it → it-disabled}/knxUltimateSceneController.html +0 -0
  67. /package/nodes/locales/{it → it-disabled}/knxUltimateSceneController.json +0 -0
  68. /package/nodes/locales/{it → it-disabled}/knxUltimateViewer.html +0 -0
  69. /package/nodes/locales/{it → it-disabled}/knxUltimateViewer.json +0 -0
  70. /package/nodes/locales/{it → it-disabled}/knxUltimateWatchDog.html +0 -0
  71. /package/nodes/locales/{it → it-disabled}/knxUltimateWatchDog.json +0 -0
  72. /package/nodes/locales/{zh-CN → zh-CN-disabled}/knxUltimate-config.html +0 -0
  73. /package/nodes/locales/{zh-CN → zh-CN-disabled}/knxUltimate-config.json +0 -0
  74. /package/nodes/locales/{zh-CN → zh-CN-disabled}/knxUltimate.html +0 -0
  75. /package/nodes/locales/{zh-CN → zh-CN-disabled}/knxUltimate.json +0 -0
  76. /package/nodes/locales/{zh-CN → zh-CN-disabled}/knxUltimateAlerter.html +0 -0
  77. /package/nodes/locales/{zh-CN → zh-CN-disabled}/knxUltimateAlerter.json +0 -0
  78. /package/nodes/locales/{zh-CN → zh-CN-disabled}/knxUltimateGlobalContext.html +0 -0
  79. /package/nodes/locales/{zh-CN → zh-CN-disabled}/knxUltimateGlobalContext.json +0 -0
  80. /package/nodes/locales/{zh-CN → zh-CN-disabled}/knxUltimateLoadControl.html +0 -0
  81. /package/nodes/locales/{zh-CN → zh-CN-disabled}/knxUltimateLoadControl.json +0 -0
  82. /package/nodes/locales/{zh-CN → zh-CN-disabled}/knxUltimateLogger.html +0 -0
  83. /package/nodes/locales/{zh-CN → zh-CN-disabled}/knxUltimateLogger.json +0 -0
  84. /package/nodes/locales/{zh-CN → zh-CN-disabled}/knxUltimateSceneController.html +0 -0
  85. /package/nodes/locales/{zh-CN → zh-CN-disabled}/knxUltimateSceneController.json +0 -0
  86. /package/nodes/locales/{zh-CN → zh-CN-disabled}/knxUltimateViewer.html +0 -0
  87. /package/nodes/locales/{zh-CN → zh-CN-disabled}/knxUltimateViewer.json +0 -0
  88. /package/nodes/locales/{zh-CN → zh-CN-disabled}/knxUltimateWatchDog.html +0 -0
  89. /package/nodes/locales/{zh-CN → zh-CN-disabled}/knxUltimateWatchDog.json +0 -0
package/CHANGELOG.md CHANGED
@@ -7,6 +7,15 @@
7
7
  # CHANGELOG
8
8
 
9
9
  <p>
10
+ <b>Version 2.0.1</b> - June 2023<br/>
11
+ - NEW: more KNX group addresses in the HUE Light node<br/>
12
+ </p>
13
+ <p>
14
+ <b>Version 2.0.0</b> - June 2023<br/>
15
+ - NEW Added HUE Light node. More HUE nodes to come. Please feel free to try it.<br/>
16
+ - Global context node: in the node name, only chas a-z are now allowed, to overcome syntax errors.<br/>
17
+ - As i spend 50% of my time to translate all documentation and node texts to 4 languages, i'll leave only English as main language, so you will see the UI only in English.<br/>
18
+ </p>
10
19
  <b>Version 1.4.18</b> - Mai 2023<br/>
11
20
  - NEW: Gateway Config Node: Starting from version 1.4.18, you can also simply enter the path to the ETS exported file (e.g.: /home/pi/mycsv.csv), instead of pasting it's content.<br/>
12
21
  </p>
@@ -95,7 +95,7 @@ dpts.populateAPDU = function (value, apdu, dptid) {
95
95
  }
96
96
  }
97
97
  // generic APDU is assumed to convey an unsigned integer of arbitrary bitlength
98
- if (dpt.basetype.hasOwnProperty('signedness') && dpt.basetype.signedness == 'signed') {
98
+ if (dpt.basetype.hasOwnProperty('signedness') && dpt.basetype.signedness === 'signed') {
99
99
  apdu.data.writeIntBE(tgtvalue, 0, nbytes)
100
100
  } else {
101
101
  apdu.data.writeUIntBE(tgtvalue, 0, nbytes)
@@ -9,5 +9,15 @@
9
9
  "path": "../node-red-contrib-knx-ultimate.wiki"
10
10
  }
11
11
  ],
12
- "settings": {}
12
+ "settings": {
13
+
14
+ "editor.defaultFormatter": "rvest.vs-code-prettier-eslint",
15
+ "editor.formatOnPaste": false, // required
16
+ "editor.formatOnType": false, // required
17
+ "editor.formatOnSave": true, // optional
18
+ "editor.formatOnSaveMode": "file", // required to format on save
19
+ "files.autoSave": "onFocusChange", // optional but recommended
20
+ "vs-code-prettier-eslint.prettierLast": "false" // set as "true" to run 'prettier' last not first
21
+
22
+ }
13
23
  }
package/README.md CHANGED
@@ -35,6 +35,7 @@ msg.payload = {red:255, green:200, blue:30} // Put some colors in our life
35
35
  * **ALERTER node** [here](https://github.com/Supergiovane/node-red-contrib-knx-ultimate/wiki/Alerter-Configuration). With the Alerter node you can signal to a display or to the node-red-contrib-tts-ultimate node (audio feedback), whenever the selected devices are alerted, i.e. they have payload **true**.
36
36
  * **LOAD CONTROL node** [here](https://github.com/Supergiovane/node-red-contrib-knx-ultimate/wiki/LoadControl-Configuration). Control your loads (Oven, Washing machine, etc..) and avoit shutting down the main voltage due to too high power consumption.
37
37
  * **VIEWER node** [here](https://github.com/Supergiovane/node-red-contrib-knx-ultimate/wiki/knxUltimateViewer). View all Group Addresses and values of your KNX BUS, in the Node-Red Dashboard.
38
+ * **PHILIPS HUE nodeset** [here](https://github.com/Supergiovane/node-red-contrib-knx-ultimate/wiki/en-hue-configuration). Link HUE lights and sensors to KNX in a simple way.
38
39
 
39
40
  <br>
40
41
  <br>
@@ -62,13 +63,10 @@ High knowledge of cryptography and KNX is needed.
62
63
 
63
64
  ## HELP, SAMPLES, TROUBLESHOOT, WIKI, FAQ, BEST PRACTICES
64
65
 
65
- Click your language to go to the documentation.<br/>
66
66
  <a href="https://github.com/Supergiovane/node-red-contrib-knx-ultimate/wiki/Overview"><img src="https://raw.githubusercontent.com/Supergiovane/node-red-contrib-knx-ultimate/master/img/wiki/flags/usa-today.png"/></a>
67
- <a href="https://github.com/Supergiovane/node-red-contrib-knx-ultimate/wiki/de-Overview"><img src="https://raw.githubusercontent.com/Supergiovane/node-red-contrib-knx-ultimate/master/img/wiki/flags/germany.png"/></a>
68
- <a href="https://github.com/Supergiovane/node-red-contrib-knx-ultimate/wiki/it-Overview"><img src="https://raw.githubusercontent.com/Supergiovane/node-red-contrib-knx-ultimate/master/img/wiki/flags/italy.png"/></a>
69
- <a href="https://github.com/Supergiovane/node-red-contrib-knx-ultimate/wiki/cn-Overview"><img src="https://raw.githubusercontent.com/Supergiovane/node-red-contrib-knx-ultimate/master/img/wiki/flags/cn.png"/></a><br/>
70
67
 
71
- > Click a language above. Tons of documentation, samples, even for use in conjunction with <img width="90px" src="https://raw.githubusercontent.com/Supergiovane/node-red-contrib-knx-ultimate/master/img/homekit.png" > <img width="70px" src="https://raw.githubusercontent.com/Supergiovane/node-red-contrib-knx-ultimate/master/img/alexa.png" > <img width="90px" src="https://raw.githubusercontent.com/Supergiovane/node-red-contrib-knx-ultimate/master/img/googleassistant.png" >
68
+
69
+ > Tons of documentation, samples, even for use in conjunction with <img width="90px" src="https://raw.githubusercontent.com/Supergiovane/node-red-contrib-knx-ultimate/master/img/homekit.png" > <img width="70px" src="https://raw.githubusercontent.com/Supergiovane/node-red-contrib-knx-ultimate/master/img/alexa.png" > <img width="90px" src="https://raw.githubusercontent.com/Supergiovane/node-red-contrib-knx-ultimate/master/img/googleassistant.png" >
72
70
 
73
71
 
74
72
 
package/img/hue.png ADDED
Binary file
package/img/huehub.jpg ADDED
Binary file
package/img/knx.png ADDED
Binary file
@@ -0,0 +1,132 @@
1
+ <script type="text/javascript">
2
+ RED.nodes.registerType('hue-config', {
3
+ category: 'config',
4
+ defaults: {
5
+ host: { value: "" },
6
+ name: { value: "Hue Bridge" },
7
+ bridgeid: { value: "" }
8
+ },
9
+ credentials: {
10
+ username: { type: "password" },
11
+ clientkey: { type: "password" }
12
+ },
13
+ oneditprepare: function () {
14
+
15
+
16
+ $("#getinfocam").click(function () {
17
+
18
+ var myNotification = RED.notify("Please press the Link button on the HUE Bridge / Pre favore, premi il pulsante sul bridge HUE",
19
+ {
20
+ modal: true,
21
+ fixed: true,
22
+ type: 'info',
23
+ buttons: [
24
+ {
25
+ text: "OK",
26
+ click: function (e) {
27
+ // Send the infos to Supergiovane
28
+ $.getJSON("KNXUltimateRegisterToHueBridge", (data) => {
29
+ this.value = "Connect";
30
+ this.disabled = false;
31
+ if (data.hasOwnProperty("error")) {
32
+ RED.notify(JSON.stringify(data.error),
33
+ {
34
+ modal: true,
35
+ fixed: false,
36
+ type: 'error'
37
+ });
38
+ this.disabled = true;
39
+ return;
40
+ }
41
+
42
+ // Expected { bridge: bridgeConfig, user: createdUser }
43
+ $("#node-config-input-name").val(data.bridge.data.name);
44
+ $("#node-config-input-host").val(data.bridge.data.ipaddress);
45
+ $("#node-config-input-username").val(data.user.username);
46
+ $("#node-config-input-clientkey").val(data.user.clientkey);
47
+ $("#node-config-input-bridgeid").val(data.bridge.data.bridgeid);
48
+
49
+ }).error(function (jqXHR, textStatus, errorThrown) {
50
+ RED.notify("Something went wrong. Please create at least a KNX Gateway node first.",
51
+ {
52
+ modal: false,
53
+ fixed: false,
54
+ type: 'error'
55
+ })
56
+ });
57
+ myNotification.close();
58
+ }
59
+ },
60
+ {
61
+ text: "CANCEL",
62
+ click: function (e) {
63
+ myNotification.close();
64
+ }
65
+ }]
66
+ });
67
+
68
+
69
+
70
+
71
+ });
72
+
73
+
74
+ },
75
+ oneditsave: function () {
76
+
77
+ },
78
+ label: function () {
79
+ return typeof this.name === undefined ? "Hue Bridge " + this.host : this.name + " " + this.host;
80
+ }
81
+ });
82
+ </script>
83
+
84
+
85
+ <script type="text/x-red" data-template-name="hue-config">
86
+ <div class="form-row">
87
+ <b><span data-i18n="hue-config.properties.title"></span></b>&nbsp&nbsp<span style="color:red" data-i18n="[html]hue-config.properties.helplink"></span>
88
+
89
+ <p align='center'> <img src='https://raw.githubusercontent.com/Supergiovane/node-red-contrib-knx-ultimate/master/img/huehub.jpg' width='40%'></p>
90
+
91
+
92
+
93
+ <div class="form-row">
94
+ <label><i class="fa fa-sign-in"></i>&nbsp&nbsp<span data-i18n="hue-config.properties.getinfocam"</span></label>
95
+ <input type="button" id="getinfocam" class="ui-button ui-corner-all ui-widget" style="background-color:#AEE1FF;width:150px" value="CONNECT">
96
+ </div>
97
+
98
+ <div class="form-row">
99
+ <label for="node-config-input-name">
100
+ <i class="fa fa-tag"></i>
101
+ <span data-i18n="hue-config.properties.node-config-input-name"</span>
102
+ </label>
103
+ <input type="text" id="node-config-input-name" ><data-i18n="[Title]hue-config.properties.node-config-input-name" style="margin-left:5px;">
104
+ </div>
105
+
106
+ <div class="form-row">
107
+ <label for="node-config-input-bridgeid">
108
+ <i class="fa fa-tag"></i>
109
+ Bridge ID
110
+ </label>
111
+ <input type="text" id="node-config-input-bridgeid" disabled>
112
+ </div>
113
+
114
+ <div class="form-row">
115
+ <label for="node-config-input-host">
116
+ <i class="fa fa-server"></i>
117
+ <span data-i18n="hue-config.properties.host"</span>
118
+ </label>
119
+ <input type="text" id="node-config-input-host"><data-i18n="[Title]hue-config.properties.host_info" style="margin-left:5px;">
120
+ </div>
121
+ <div class="form-row">
122
+ <label for="node-config-input-username"> Username</label>
123
+ <input type="password" id="node-config-input-username" placeholder="">
124
+ </div>
125
+ <div class="form-row">
126
+ <label for="node-config-input-clientkey"> Bridge Key</label>
127
+ <input type="password" id="node-config-input-clientkey" placeholder="">
128
+ </div>
129
+
130
+
131
+
132
+ </script>
@@ -0,0 +1,150 @@
1
+
2
+ const dptlib = require('./../KNXEngine/dptlib')
3
+ const hueClass = require('./utils/hueUtils').classHUE
4
+
5
+ // Helpers
6
+ const sortBy = (field) => (a, b) => {
7
+ if (a[field] > b[field]) { return 1 } else { return -1 }
8
+ }
9
+
10
+ const onlyDptKeys = (kv) => {
11
+ return kv[0].startsWith('DPT')
12
+ }
13
+
14
+ const extractBaseNo = (kv) => {
15
+ return {
16
+ subtypes: kv[1].subtypes,
17
+ base: parseInt(kv[1].id.replace('DPT', ''))
18
+ }
19
+ }
20
+
21
+ const convertSubtype = (baseType) => (kv) => {
22
+ const value = `${baseType.base}.${kv[0]}`
23
+ // let sRet = value + " " + kv[1].name + (kv[1].unit === undefined ? "" : " (" + kv[1].unit + ")");
24
+ const sRet = value + ' ' + kv[1].name
25
+ return {
26
+ value,
27
+ text: sRet
28
+ }
29
+ }
30
+
31
+ // 06/02/2020 To be tested
32
+ // convertSubtype = (baseType) => (kv) => {
33
+ // let value = `${baseType.base}.${kv[0]}`
34
+ // return {
35
+ // value: value
36
+ // , text: value + ` (${kv[1].name}${kv[1].unit !== undefined?" - " + kv[1].unit:""})`
37
+ // }
38
+ // }
39
+
40
+ const toConcattedSubtypes = (acc, baseType) => {
41
+ const subtypes =
42
+ Object.entries(baseType.subtypes)
43
+ .sort(sortBy(0))
44
+ .map(convertSubtype(baseType))
45
+
46
+ return acc.concat(subtypes)
47
+ }
48
+
49
+ module.exports = (RED) => {
50
+ 'use strict'
51
+
52
+ RED.httpAdmin.get('/knxUltimateDpts', RED.auth.needsPermission('hue-config.read'), function (req, res) {
53
+ const dpts =
54
+ Object.entries(dptlib)
55
+ .filter(onlyDptKeys)
56
+ .map(extractBaseNo)
57
+ .sort(sortBy('base'))
58
+ .reduce(toConcattedSubtypes, [])
59
+
60
+ res.json(dpts)
61
+ // Utilità per visualizzare i datapoints, da copiare in README
62
+ // var stringa = "";
63
+ // for (let index = 0; index < dpts.length; index++) {
64
+ // const element = dpts[index];
65
+ // stringa += element.text + "<br/>\n";
66
+ // }
67
+ // if (node.sysLogger !== undefined && node.sysLogger !== null) node.sysLogger.warn(stringa)
68
+ })
69
+
70
+ function hueConfig(config) {
71
+ RED.nodes.createNode(this, config)
72
+ const node = this
73
+ node.host = config.host
74
+ node.nodeClients = [] // Stores the registered clients
75
+ node.loglevel = config.loglevel !== undefined ? config.loglevel : 'error' // 18/02/2020 Loglevel default error
76
+ node.sysLogger = null // 20/03/2022 Default
77
+ try {
78
+ node.sysLogger = require('./utils/sysLogger.js').get({ loglevel: node.loglevel }) // 08/04/2021 new logger to adhere to the loglevel selected in the config-window
79
+ } catch (error) { }
80
+ node.name = (config.name === undefined || config.name === '') ? node.host : config.name // 12/08/2021
81
+
82
+ // Init HUE Utility
83
+ node.hueManager = new hueClass(node.host, node.credentials.username, node.credentials.clientkey, config.bridgeid)
84
+
85
+ // Event clip V2
86
+ node.hueManager.on('event', _event => {
87
+ node.nodeClients.forEach(_oClient => {
88
+ const oClient = RED.nodes.getNode(_oClient.id)
89
+ oClient.handleSendHUE(_event)
90
+ })
91
+ })
92
+
93
+ // Endpoint for connecting to HUE Bridge
94
+ RED.httpAdmin.get('/KNXUltimateGetAllLightsHUE', RED.auth.needsPermission('hue-config.read'), function (req, res) {
95
+ try {
96
+ (async () => {
97
+ try {
98
+ // °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
99
+ const jRet = await node.hueManager.getAllLights()
100
+ res.json(jRet)
101
+ // °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
102
+ } catch (err) {
103
+ RED.log.error('Errore KNXUltimateGetAllLightsHUE non gestito ' + err.message)
104
+ res.json({ error: err.message })
105
+ }
106
+ })()
107
+ } catch (err) {
108
+ RED.log.error('Errore KNXUltimateGetAllLightsHUE bsonto ' + err.message)
109
+ res.json({ error: err.message })
110
+ }
111
+ })
112
+
113
+
114
+ node.addClient = (_Node) => {
115
+ // Check if node already exists
116
+ if (node.nodeClients.filter(x => x.id === _Node.id).length === 0) {
117
+ // Add _Node to the clients array
118
+ _Node.setNodeStatus({ fill: 'grey', shape: 'ring', text: 'Hue initialized.', payload: '', GA: '', dpt: '', devicename: '' })
119
+ // 01/06/2023 Add node to the array
120
+ const jNode = {}
121
+ jNode.id = _Node.id
122
+ jNode.topic = _Node.topic
123
+ node.nodeClients.push(jNode)
124
+ }
125
+ }
126
+
127
+ node.removeClient = (_Node) => {
128
+ // Remove the client node from the clients array
129
+ try {
130
+ node.nodeClients = node.nodeClients.filter(x => x.id !== _Node.id)
131
+ } catch (error) { }
132
+ }
133
+
134
+ node.on('close', function (done) {
135
+ try {
136
+ if (node.sysLogger !== undefined && node.sysLogger !== null) node.sysLogger.destroy()
137
+ node.nodeClients = []
138
+ } catch (error) { }
139
+ done()
140
+ })
141
+ }
142
+
143
+ // RED.nodes.registerType("hue-config", hue-config);
144
+ RED.nodes.registerType('hue-config', hueConfig, {
145
+ credentials: {
146
+ username: { type: 'password' },
147
+ clientkey: { type: 'password' }
148
+ }
149
+ })
150
+ }
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- Generated by Pixelmator Pro 3.3.5 -->
3
+ <svg width="40" height="60" viewBox="0 0 40 60" xmlns="http://www.w3.org/2000/svg">
4
+ <path id="philipshue-white" fill="#ffffff" stroke="none" d="M 33.730667 10.312656 C 30.495916 10.312656 28.181084 12.442097 27.900833 15.560974 L 26.849501 15.560974 C 26.458418 15.560974 26.224083 15.782215 26.224083 16.150951 C 26.224083 16.519684 26.458418 16.740925 26.849501 16.740925 L 27.896082 16.740925 C 28.136749 19.951984 30.511749 22 34.094833 22 C 35.5895 22 36.762749 21.778759 37.787167 21.304012 C 38.037334 21.188786 38.320747 20.970615 38.2495 20.580372 C 38.231464 20.428261 38.144367 20.291912 38.011997 20.208565 C 37.847332 20.1087 37.616165 20.097942 37.343834 20.177837 C 37.156597 20.235058 36.970768 20.296528 36.786499 20.362206 C 36.131001 20.586517 35.56575 20.781639 34.254749 20.781639 C 31.483917 20.781639 29.650415 19.209908 29.580751 16.779335 L 29.580751 16.740925 L 38.200417 16.740925 C 38.695999 16.740925 38.979416 16.488956 39 16.029575 L 39 15.940464 C 38.990498 10.719799 34.965668 10.312656 33.730667 10.312656 Z M 37.492668 15.560974 L 29.576 15.560974 L 29.582333 15.507202 C 29.773916 13.0797 31.420582 11.511044 33.776585 11.511044 C 35.572083 11.511044 37.492668 12.563473 37.492668 15.514885 Z M 16.108166 11.266758 C 16.108166 10.752064 15.799417 10.446323 15.284834 10.446323 C 14.770249 10.446323 14.4615 10.753601 14.4615 11.266758 L 14.4615 15.560974 L 16.108166 15.560974 Z M 22.900667 17.131168 C 22.900667 19.165356 21.399666 20.758595 19.480667 20.758595 C 17.21175 20.758595 16.108166 19.586327 16.108166 17.174187 L 16.108166 16.740925 L 14.4615 16.740925 L 14.4615 17.263298 C 14.4615 20.406761 15.989417 22 19.002501 22 C 20.775833 22 22.078917 21.253311 22.870583 19.779911 L 22.90225 19.724602 L 22.90225 21.047436 C 22.90225 21.560589 23.207834 21.86787 23.724001 21.86787 C 24.238583 21.86787 24.547333 21.560589 24.547333 21.047436 L 24.547333 16.740925 L 22.900667 16.740925 Z M 23.724001 10.446323 C 23.207834 10.446323 22.900667 10.753601 22.900667 11.266758 L 22.900667 15.560974 L 24.547333 15.560974 L 24.547333 11.266758 C 24.547333 10.752064 24.238583 10.446323 23.724001 10.446323 Z M 6.77125 10.312656 C 4.142917 10.312656 3.11375 11.959671 2.858833 12.463608 L 2.645083 12.890724 L 2.645083 6.863453 C 2.645083 6.330326 2.33 6 1.82175 6 C 1.315083 6 1 6.330326 1 6.863453 L 1 15.560974 L 2.645083 15.560974 L 2.645083 15.53793 C 2.645083 13.618973 3.785083 11.555599 6.293083 11.555599 C 8.335583 11.555599 9.461333 12.827732 9.461333 15.138466 L 9.461333 15.560974 L 11.108 15.560974 L 11.108 15.183022 C 11.108 12.042633 9.567416 10.312656 6.77125 10.312656 Z M 1 21.00288 C 1 21.536011 1.315083 21.86787 1.823333 21.86787 C 2.33 21.86787 2.645083 21.536011 2.645083 21.00288 L 2.645083 16.740925 L 1 16.740925 Z M 9.461333 21.00288 C 9.461333 21.536011 9.778 21.86787 10.284666 21.86787 C 10.791333 21.86787 11.108 21.536011 11.108 21.00288 L 11.108 16.740925 L 9.461333 16.740925 Z"/>
5
+ <g id="Gruppo">
6
+ <g id="g1">
7
+ <path id="Percorso" fill="#ffffff" stroke="#ffffff" stroke-width="0.5" d="M 39.5 38 L 30.299999 30.299999 C 29.799999 29.9 29 29.9 28.4 30.299999 C 28.200001 30.5 28 30.799999 28 31.1 L 28 34.400002 L 18.799999 34.400002 C 18.1 34.400002 17.5 34.900002 17.5 35.5 C 17.5 36.099998 18.1 36.599998 18.799999 36.599998 L 29.299999 36.599998 C 30 36.599998 30.6 36.099998 30.6 35.5 L 30.6 33.799999 L 36.599998 38.799999 L 30.6 43.799999 L 30.6 42.099998 C 30.6 41.5 30 41 29.299999 41 L 14.9 41 L 14.9 37.700001 C 14.9 37.099998 14.3 36.599998 13.6 36.599998 C 13.3 36.599998 12.9 36.700001 12.7 36.900002 L 3.5 44.599998 C 3 45 3 45.700001 3.5 46.200001 L 12.7 53.900002 C 12.9 54.099998 13.3 54.200001 13.6 54.200001 C 13.8 54.200001 13.9 54.200001 14.1 54.099998 C 14.6 53.900002 14.9 53.5 14.9 53.099998 L 14.9 49.799999 L 24.1 49.799999 C 24.799999 49.799999 25.4 49.299999 25.4 48.700001 C 25.4 48.099998 24.799999 47.599998 24.1 47.599998 L 13.6 47.599998 C 12.9 47.599998 12.3 48.099998 12.3 48.700001 L 12.3 50.400002 L 6.3 45.400002 L 12.3 40.400002 L 12.3 42.099998 C 12.3 42.700001 12.9 43.200001 13.6 43.200001 L 28 43.200001 L 28 46.5 C 28 47.099998 28.6 47.599998 29.299999 47.599998 C 29.6 47.599998 30 47.5 30.200001 47.299999 L 39.400002 39.599998 C 40 39.200001 40 38.5 39.5 38 Z"/>
8
+ </g>
9
+ </g>
10
+ </svg>