From cefca02f55dcac0cafb0cbeea9c5efed6ceabb64 Mon Sep 17 00:00:00 2001 From: Marco Klement Date: Mon, 10 Feb 2025 12:27:00 +0100 Subject: [PATCH] TA-765: determines currentDeviceState from SourceClients --- src/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index 07c75643..9590287e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1361,10 +1361,10 @@ function UpdateDeviceState(deviceId: string) { // bus is unlinked for (let i = 0; i < deviceSources.length; i++) { let deviceSource = deviceSources[i] - let currentSourceTally = currentSourceTallyData?.[deviceSource.sourceId] || [] - //console.log('currentSourceTallyData', currentSourceTallyData); - //console.log('currentSourceTally', currentSourceTally); - if (currentSourceTallyData?.[deviceSource.sourceId]?.includes(bus.id)) { + + let data = SourceClients[deviceSource.sourceId]?.tally?.value || [] + + if (data?.[deviceSource.address]?.includes(bus.id)) { //if the current source tally data includes this bus //if the current source tally data includes this bus //console.log('pushing', bus.label); currentDeviceTallyData[device.id].push(bus.id)