Skip to content

Commit 697eb7e

Browse files
committed
TA-765: determines currentDeviceState from SourceClients
1 parent f0d2cb8 commit 697eb7e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: src/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1201,10 +1201,10 @@ function UpdateDeviceState(deviceId: string) {
12011201
// bus is unlinked
12021202
for (let i = 0; i < deviceSources.length; i++) {
12031203
let deviceSource = deviceSources[i];
1204-
let currentSourceTally = currentSourceTallyData?.[deviceSource.sourceId] || [];
1205-
//console.log('currentSourceTallyData', currentSourceTallyData);
1206-
//console.log('currentSourceTally', currentSourceTally);
1207-
if (currentSourceTallyData?.[deviceSource.sourceId]?.includes(bus.id)) { //if the current source tally data includes this bus
1204+
1205+
let data = SourceClients[deviceSource.sourceId]?.tally?.value || []
1206+
1207+
if (data?.[deviceSource.address]?.includes(bus.id)) { //if the current source tally data includes this bus
12081208
//console.log('pushing', bus.label);
12091209
currentDeviceTallyData[device.id].push(bus.id);
12101210
if (!previousBusses.includes(bus.id)) {

0 commit comments

Comments
 (0)