Skip to content

Commit cbfa72c

Browse files
Tiwasclaude
andcommitted
fix(clg-collection): route flow actions to actual member devices
Pairing stored Homey's UUID in config.devices[].id while resolveMemberEntries looked it up against the local device's getData().id. The two id spaces never matched, so every fan-out silently failed and pause/resume/turn-on/apply were no-ops on members. Pair now stores data.id; lookup also accepts the legacy UUID via device.id so existing Collections work without re-pairing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 92774a9 commit cbfa72c

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

no.tiwas.booleantoolbox/drivers/circadian-light-group-collection/device.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,21 @@ class CircadianLightGroupCollectionDevice extends CircadianLightGroupDevice {
2424
}
2525

2626
resolveMemberEntries() {
27-
const byId = new Map();
27+
const byDataId = new Map();
28+
const byHomeyId = new Map();
2829
this.getAvailableCircadianGroups().forEach(device => {
2930
const dataId = device.getData?.().id;
30-
if (dataId) byId.set(dataId, device);
31+
if (dataId) byDataId.set(dataId, device);
32+
// device.id is the Homey-wide UUID exposed on local device instances
33+
const homeyId = device.id;
34+
if (homeyId) byHomeyId.set(homeyId, device);
3135
});
3236

3337
return this.getMemberItems().map(item => ({
3438
id: item.id,
3539
name: item.name || item.id,
3640
item,
37-
memberDevice: byId.get(item.id) || null,
41+
memberDevice: byDataId.get(item.id) || byHomeyId.get(item.id) || null,
3842
}));
3943
}
4044

no.tiwas.booleantoolbox/drivers/circadian-light-group-collection/driver.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,10 @@ class CircadianLightGroupCollectionDriver extends CircadianLightGroupDriver {
121121
};
122122
}
123123

124+
const dataId = homeyDevice.data?.id || homeyDevice.id;
124125
candidates.push({
125-
id: homeyDevice.id,
126+
id: dataId,
127+
homeyDeviceId: homeyDevice.id,
126128
name: homeyDevice.name,
127129
zoneName: allZones[homeyDevice.zone] ? allZones[homeyDevice.zone].name : 'Unknown',
128130
capabilities: supportedCapabilities,

0 commit comments

Comments
 (0)