node-red-contrib-knx-ultimate 2.3.0 → 2.3.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/CHANGELOG.md CHANGED
@@ -6,6 +6,9 @@
6
6
 
7
7
  # CHANGELOG
8
8
 
9
+ **Version 2.3.2** - Jan 2024<br/>
10
+ - HUE Light: minor fixes.
11
+
9
12
  **Version 2.3.0** - Jan 2024<br/>
10
13
  - HUE Light: partially rewrote code to cloneDeep(oHUEDevice) not to duplicate the brightness status of a single ligh, at node-red restart. https://github.com/Supergiovane/node-red-contrib-knx-ultimate/issues/312#issue-2064480332 <br/>
11
14
 
@@ -508,7 +508,7 @@ module.exports = (RED) => {
508
508
  try {
509
509
  const _lightId = req.query.id;
510
510
  const oLight = node.hueAllResources.filter((a) => a.id === _lightId)[0];
511
- // Infer some useful info, so the HTML part cann avoid to query the server
511
+ // Infer some useful info, so the HTML part can avoid to query the server
512
512
  // Kelvin
513
513
  try {
514
514
  if (oLight.color_temperature !== undefined && oLight.color_temperature.mirek !== undefined) {
@@ -183,11 +183,14 @@
183
183
  }
184
184
 
185
185
  .ui-tabs .ui-tabs-nav .ui-state-default a {
186
- color: #c0c0c0;
186
+ color: #878787;
187
+ outline: none;
187
188
  }
188
189
 
189
190
  .ui-tabs .ui-tabs-nav .ui-state-active a {
190
- color: #459e00;
191
+ color: #377e00;
192
+ border-bottom: 1px solid#377e00;
193
+ outline: none;
191
194
  }
192
195
  </style>
193
196
 
@@ -172,137 +172,140 @@
172
172
 
173
173
 
174
174
  // Get the HUE capabilities to enable/disable UI parts
175
- $.getJSON("knxUltimateGetLightObject?id=" + $("#node-input-hueDevice").val().split("#")[0], (data) => {
176
- let oLight = data;
177
- // Check if grouped, to hide/show the "Get current" buttons
178
- if (oLight.type === "grouped_light") {
179
- $("#tabs").tabs("enable", "#tabs-4");
180
- $("#tabs").tabs("enable", "#tabs-3");
181
- $("#tabs").tabs("enable", "#tabs-2");
182
- $("#getColorAtSwitchOnDayTimeButton").show();
183
- $("#getColorAtSwitchOnNightTimeButton").show();
184
- $("#node-input-specifySwitchOnBrightness").empty().append(
185
- $("<option>")
186
- .val("no")
187
- .text("None")
188
- ).append(
189
- $("<option>")
190
- .val("yes")
191
- .text("Select color")
192
- ).append(
193
- $("<option>")
194
- .val("temperature")
195
- .text("Select temperature and brightness")
196
- );
197
- $("#node-input-enableDayNightLighting").empty().append(
198
- $("<option>")
199
- .val("no")
200
- .text("No")
201
- ).append(
202
- $("<option>")
203
- .val("yes")
204
- .text("Select color")
205
- ).append(
206
- $("<option>")
207
- .val("temperature")
208
- .text("Select temperature and brightness")
209
- );
210
- $("#node-input-specifySwitchOnBrightness").val(node.specifySwitchOnBrightness).trigger('change');
211
- $("#node-input-enableDayNightLighting").val(node.enableDayNightLighting).trigger('change');
212
- return;
213
- } else {
214
-
215
- $("#getColorAtSwitchOnDayTimeButton").show();
216
- $("#getColorAtSwitchOnNightTimeButton").show();
217
- $("#node-input-specifySwitchOnBrightness").empty().append(
218
- $("<option>")
219
- .val("no")
220
- .text("None")
221
- );
222
- $("#node-input-enableDayNightLighting").empty().append(
223
- $("<option>")
224
- .val("no")
225
- .text("No")
226
- );
227
- }
175
+ if ($("#node-input-hueDevice").val() === '') {
176
+ $("#tabs").hide();
177
+ } else {
178
+ $.getJSON("knxUltimateGetLightObject?id=" + $("#node-input-hueDevice").val().split("#")[0] + "&" + { _: new Date().getTime() }, (data) => {
179
+ let oLight = data;
180
+ // Check if grouped, to hide/show the "Get current" buttons
181
+ if (oLight.type === "grouped_light") {
182
+ $("#tabs").tabs("enable", "#tabs-4");
183
+ $("#tabs").tabs("enable", "#tabs-3");
184
+ $("#tabs").tabs("enable", "#tabs-2");
185
+ $("#getColorAtSwitchOnDayTimeButton").show();
186
+ $("#getColorAtSwitchOnNightTimeButton").show();
187
+ $("#node-input-specifySwitchOnBrightness").empty().append(
188
+ $("<option>")
189
+ .val("no")
190
+ .text("None")
191
+ ).append(
192
+ $("<option>")
193
+ .val("yes")
194
+ .text("Select color")
195
+ ).append(
196
+ $("<option>")
197
+ .val("temperature")
198
+ .text("Select temperature and brightness")
199
+ );
200
+ $("#node-input-enableDayNightLighting").empty().append(
201
+ $("<option>")
202
+ .val("no")
203
+ .text("No")
204
+ ).append(
205
+ $("<option>")
206
+ .val("yes")
207
+ .text("Select color")
208
+ ).append(
209
+ $("<option>")
210
+ .val("temperature")
211
+ .text("Select temperature and brightness")
212
+ );
213
+ $("#node-input-specifySwitchOnBrightness").val(node.specifySwitchOnBrightness).trigger('change');
214
+ $("#node-input-enableDayNightLighting").val(node.enableDayNightLighting).trigger('change');
215
+ return;
216
+ } else {
228
217
 
229
- $("#tabs").tabs("disable", "#tabs-4");
230
- $("#tabs").tabs("disable", "#tabs-3");
231
- $("#tabs").tabs("disable", "#tabs-2");
232
- $("#divColorsAtSwitchOn").hide();
233
- $("#divColorsAtSwitchOnNightTime").hide();
234
- $("#divTemperatureAtSwitchOn").hide();
235
- $("#divTemperatureAtSwitchOnNightTime").hide();
236
- $("#divColorCycle").hide();
237
- $("#divUpdateKNXBrightnessStatusOnHUEOnOff").hide();
238
- $("#divBehaviourBrightness").hide();
239
- $("#comboTemperatureAtSwitchOn").hide();
240
- $("#comboTemperatureAtSwitchOnNightTime").hide();
241
-
242
- // Enable options/tabs one by one
243
- if (oLight.dimming !== undefined) {
244
- $("#tabs").tabs("enable", "#tabs-2");
245
- $("#divBehaviourBrightness").show();
246
- }
247
- if (oLight.color !== undefined) {
248
- $("#tabs").tabs("enable", "#tabs-4");
249
- $("#divColorsAtSwitchOn").show();
250
- $("#divColorsAtSwitchOnNightTime").show();
251
- $("#divColorCycle").show();
252
- $("#node-input-specifySwitchOnBrightness").append(
253
- $("<option>")
254
- .val("yes")
255
- .text("Select color")
256
- );
257
- $("#node-input-enableDayNightLighting").append(
258
- $("<option>")
259
- .val("yes")
260
- .text("Select color")
261
- );
262
- }
263
- // Check temperature (if the light supports temperature, it support dimming as well)
264
- if (oLight.color_temperature !== undefined) {
265
- $("#tabs").tabs("enable", "#tabs-3");
266
- //$("#tabs").tabs("enable", "#tabs-2");
267
- $("#node-input-specifySwitchOnBrightness").append(
268
- $("<option>")
269
- .val("temperature")
270
- .text("Select temperature and brightness")
271
- );
272
- $("#node-input-enableDayNightLighting").append(
273
- $("<option>")
274
- .val("temperature")
275
- .text("Select temperature and brightness")
276
- );
277
- $("#divTemperatureAtSwitchOn").show();
278
- $("#divTemperatureAtSwitchOnNightTime").show();
279
- $("#divUpdateKNXBrightnessStatusOnHUEOnOff").show();
280
- $("#divBehaviourBrightness").show();
281
- $("#comboTemperatureAtSwitchOn").show();
282
- $("#comboTemperatureAtSwitchOnNightTime").show();
283
- } else {
284
- //$("#tabs").tabs("enable", "#tabs-2");
285
- $("#node-input-specifySwitchOnBrightness").append(
286
- $("<option>")
287
- .val("temperature")
288
- .text("Select brightness")
289
- );
290
- $("#node-input-enableDayNightLighting").append(
291
- $("<option>")
292
- .val("temperature")
293
- .text("Select brightness")
294
- );
295
- $("#comboTemperatureAtSwitchOn").val(0);
296
- $("#comboTemperatureAtSwitchOnNightTime").val(0);
297
- $("#divTemperatureAtSwitchOn").show();
298
- $("#divTemperatureAtSwitchOnNightTime").show();
299
- $("#divUpdateKNXBrightnessStatusOnHUEOnOff").show();
300
- //$("#divBehaviourBrightness").show();
301
- }
302
- $("#node-input-specifySwitchOnBrightness").val(node.specifySwitchOnBrightness).trigger('change');
303
- $("#node-input-enableDayNightLighting").val(node.enableDayNightLighting).trigger('change');
304
- });
218
+ $("#getColorAtSwitchOnDayTimeButton").show();
219
+ $("#getColorAtSwitchOnNightTimeButton").show();
220
+ $("#node-input-specifySwitchOnBrightness").empty().append(
221
+ $("<option>")
222
+ .val("no")
223
+ .text("None")
224
+ );
225
+ $("#node-input-enableDayNightLighting").empty().append(
226
+ $("<option>")
227
+ .val("no")
228
+ .text("No")
229
+ );
230
+ }
305
231
 
232
+ $("#tabs").tabs("disable", "#tabs-4");
233
+ $("#tabs").tabs("disable", "#tabs-3");
234
+ $("#tabs").tabs("disable", "#tabs-2");
235
+ $("#divColorsAtSwitchOn").hide();
236
+ $("#divColorsAtSwitchOnNightTime").hide();
237
+ $("#divTemperatureAtSwitchOn").hide();
238
+ $("#divTemperatureAtSwitchOnNightTime").hide();
239
+ $("#divColorCycle").hide();
240
+ $("#divUpdateKNXBrightnessStatusOnHUEOnOff").hide();
241
+ $("#divBehaviourBrightness").hide();
242
+ $("#comboTemperatureAtSwitchOn").hide();
243
+ $("#comboTemperatureAtSwitchOnNightTime").hide();
244
+
245
+ // Enable options/tabs one by one
246
+ if (oLight.dimming !== undefined) {
247
+ $("#tabs").tabs("enable", "#tabs-2");
248
+ $("#divBehaviourBrightness").show();
249
+ }
250
+ if (oLight.color !== undefined) {
251
+ $("#tabs").tabs("enable", "#tabs-4");
252
+ $("#divColorsAtSwitchOn").show();
253
+ $("#divColorsAtSwitchOnNightTime").show();
254
+ $("#divColorCycle").show();
255
+ $("#node-input-specifySwitchOnBrightness").append(
256
+ $("<option>")
257
+ .val("yes")
258
+ .text("Select color")
259
+ );
260
+ $("#node-input-enableDayNightLighting").append(
261
+ $("<option>")
262
+ .val("yes")
263
+ .text("Select color")
264
+ );
265
+ }
266
+ // Check temperature (if the light supports temperature, it support dimming as well)
267
+ if (oLight.color_temperature !== undefined) {
268
+ $("#tabs").tabs("enable", "#tabs-3");
269
+ //$("#tabs").tabs("enable", "#tabs-2");
270
+ $("#node-input-specifySwitchOnBrightness").append(
271
+ $("<option>")
272
+ .val("temperature")
273
+ .text("Select temperature and brightness")
274
+ );
275
+ $("#node-input-enableDayNightLighting").append(
276
+ $("<option>")
277
+ .val("temperature")
278
+ .text("Select temperature and brightness")
279
+ );
280
+ $("#divTemperatureAtSwitchOn").show();
281
+ $("#divTemperatureAtSwitchOnNightTime").show();
282
+ $("#divUpdateKNXBrightnessStatusOnHUEOnOff").show();
283
+ $("#divBehaviourBrightness").show();
284
+ $("#comboTemperatureAtSwitchOn").show();
285
+ $("#comboTemperatureAtSwitchOnNightTime").show();
286
+ } else {
287
+ //$("#tabs").tabs("enable", "#tabs-2");
288
+ $("#node-input-specifySwitchOnBrightness").append(
289
+ $("<option>")
290
+ .val("temperature")
291
+ .text("Select brightness")
292
+ );
293
+ $("#node-input-enableDayNightLighting").append(
294
+ $("<option>")
295
+ .val("temperature")
296
+ .text("Select brightness")
297
+ );
298
+ $("#comboTemperatureAtSwitchOn").val(0);
299
+ $("#comboTemperatureAtSwitchOnNightTime").val(0);
300
+ $("#divTemperatureAtSwitchOn").show();
301
+ $("#divTemperatureAtSwitchOnNightTime").show();
302
+ $("#divUpdateKNXBrightnessStatusOnHUEOnOff").show();
303
+ //$("#divBehaviourBrightness").show();
304
+ }
305
+ $("#node-input-specifySwitchOnBrightness").val(node.specifySwitchOnBrightness).trigger('change');
306
+ $("#node-input-enableDayNightLighting").val(node.enableDayNightLighting).trigger('change');
307
+ });
308
+ }
306
309
  // Show/Hide the div of the color at swich on
307
310
  if (node.specifySwitchOnBrightness === "yes") {
308
311
  $("#divColorsAtSwitchOn").show();
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "engines": {
4
4
  "node": ">=16.0.0"
5
5
  },
6
- "version": "2.3.0",
6
+ "version": "2.3.2",
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",