From ff87c3b5ce649971ecbea1b9811e4ee7e14add37 Mon Sep 17 00:00:00 2001 From: Darius Date: Sun, 8 Feb 2026 16:31:44 +0100 Subject: [PATCH] grist update --- src/homepage/service.ts | 43 ----------------------------------------- 1 file changed, 43 deletions(-) diff --git a/src/homepage/service.ts b/src/homepage/service.ts index a2025fa..ed2a2ad 100644 --- a/src/homepage/service.ts +++ b/src/homepage/service.ts @@ -19,7 +19,6 @@ export class HomepageService extends BaseService { private haService: HomeAssistantService; private tidalService: TidalService; private wsService: WsService; - private pollingIntervals: ReturnType[] = []; private lastPoll: FullInformation = { ha_desk_position: null, ha_temp: null, @@ -38,7 +37,6 @@ export class HomepageService extends BaseService { this.haService = haService; this.tidalService = tidalService; this.wsService = wsService; - this.listenForClientChange(); } async getFullInformation(): Promise> { @@ -223,45 +221,4 @@ export class HomepageService extends BaseService { }); } } - - listenForClientChange(): void { - this.wsService.onClientChange((clients: number) => { - if (clients === 0) { - this.stopPolling(); - } else { - if (this.pollingIntervals.length === 0) { - this.startPolling(); - } - } - }); - } - - startPolling(): void { - logInfo("Polling started"); - - const config: [ComponentUpdate[], number][] = [ - //[[{ component: "tidal", data: null }], 20_000], - //[[{ component: "desk", data: null }], 60_000], - [ - [ - //{ component: "temp", data: null }, - { component: "grist", data: null }, - ], - 600_000, - ], - ]; - - this.pollingIntervals = config.map(([components, interval]) => - setInterval(() => { - logInfo(`Polling ${components.join(", ")}`); - this.updatePartial(components); - }, interval), - ); - } - - stopPolling(): void { - logInfo("Polling ended"); - this.pollingIntervals.forEach(clearInterval); - this.pollingIntervals = []; - } }