node-red-contrib-knx-ultimate 4.1.33 → 4.1.34

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,11 @@
6
6
 
7
7
  # CHANGELOG
8
8
 
9
+ **Version 4.1.34** - March 2026<br/>
10
+
11
+ - FIX: **KNX Hue Light** grouped light handling: when a `grouped_light` is OFF and receives color / color temperature / gradient commands, the node now presets supported member `light` resources first and only then turns the group ON, so all lamps can inherit the requested state more reliably.<br/>
12
+ - DEBUG: **KNX Hue Light** added debug traces for the new grouped-light preset-before-ON sequence.<br/>
13
+
9
14
  **Version 4.1.33** - March 2026<br/>
10
15
 
11
16
  - FIX: **KNX Hue Light** grouped light handling: when a `grouped_light` is OFF, writes for dimming, color temperature, color/xy and related dynamic updates are now fanned out to the member `light` resources when needed, instead of relying only on the grouped resource.<br/>
@@ -160,10 +160,13 @@ module.exports = function (RED) {
160
160
  const defaultOperation = node.isGrouped_light === false ? "setLight" : "setGroupedLight";
161
161
  const isGroupedLightOff = node.isGrouped_light === true && node.currentHUEDevice?.on?.on === false;
162
162
  const stateKeys = _state && typeof _state === "object" ? Object.keys(_state) : [];
163
- const actionableKeys = ["dimming", "color", "color_temperature", "gradient"];
163
+ const presetKeys = ["color", "color_temperature", "gradient"];
164
+ const actionableKeys = ["dimming", ...presetKeys];
164
165
  const hasActionablePayload = stateKeys.some((key) => actionableKeys.includes(key));
166
+ const mustPresetGroupedLightChildren = isGroupedLightOff
167
+ && stateKeys.some((key) => presetKeys.includes(key));
165
168
 
166
- if (!isGroupedLightOff || !hasActionablePayload) {
169
+ if (!mustPresetGroupedLightChildren) {
167
170
  node.serverHue.hueManager.writeHueQueueAdd(node.hueDevice, _state, defaultOperation);
168
171
  return;
169
172
  }
@@ -171,6 +174,7 @@ module.exports = function (RED) {
171
174
  (async () => {
172
175
  try {
173
176
  const groupLights = await node.serverHue.getAllLightsBelongingToTheGroup(node.hueDevice, false);
177
+ RED.log.debug(`knxUltimateHueLight: preset grouped_light children before group on. Group=${node.hueDevice} lights=${Array.isArray(groupLights) ? groupLights.length : 0}`);
174
178
  let hasWrittenAtLeastOneLight = false;
175
179
  for (let index = 0; index < groupLights.length; index++) {
176
180
  const light = groupLights[index];
@@ -178,9 +182,6 @@ module.exports = function (RED) {
178
182
  const lightState = {};
179
183
  let hasActionableStateForLight = false;
180
184
 
181
- if (_state.on !== undefined) lightState.on = cloneDeep(_state.on);
182
- if (_state.dynamics !== undefined) lightState.dynamics = cloneDeep(_state.dynamics);
183
-
184
185
  if (_state.dimming !== undefined && light.dimming !== undefined) {
185
186
  lightState.dimming = cloneDeep(_state.dimming);
186
187
  hasActionableStateForLight = true;
@@ -203,9 +204,17 @@ module.exports = function (RED) {
203
204
  hasWrittenAtLeastOneLight = true;
204
205
  }
205
206
 
206
- if (!hasWrittenAtLeastOneLight) {
207
+ if (!hasWrittenAtLeastOneLight || !hasActionablePayload) {
207
208
  node.serverHue.hueManager.writeHueQueueAdd(node.hueDevice, _state, defaultOperation);
209
+ return;
208
210
  }
211
+
212
+ if (_state?.on?.on !== true) return;
213
+
214
+ const groupedLightState = { on: cloneDeep(_state.on) };
215
+ if (_state.dynamics !== undefined) groupedLightState.dynamics = cloneDeep(_state.dynamics);
216
+ RED.log.debug(`knxUltimateHueLight: turning on grouped_light after children preset. Group=${node.hueDevice}`);
217
+ node.serverHue.hueManager.writeHueQueueAdd(node.hueDevice, groupedLightState, defaultOperation);
209
218
  } catch (error) {
210
219
  RED.log.debug(`knxUltimateHueLight: node.writeHueState fallback to grouped_light write: ${error.message}`);
211
220
  node.serverHue.hueManager.writeHueQueueAdd(node.hueDevice, _state, defaultOperation);
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "engines": {
4
4
  "node": ">=20.18.1"
5
5
  },
6
- "version": "4.1.33",
6
+ "version": "4.1.34",
7
7
  "description": "Control your KNX and KNX Secure intallation via Node-Red! A bunch of KNX nodes, with integrated Philips HUE control, ETS group address importer, and KNX routing between interfaces. Easy to use and highly configurable.",
8
8
  "files": [
9
9
  "nodes/",