diff --git a/src/homepage/private-routes.ts b/src/homepage/private-routes.ts index b2e1bc1..f9718a9 100644 --- a/src/homepage/private-routes.ts +++ b/src/homepage/private-routes.ts @@ -1,10 +1,10 @@ import { - StatusComponent, - type ComponentUpdate, - type GristRecord_PersonalGoals, - type HA_Update, - type HomeAssistantEntity, - type TidalGetCurrent, + type ComponentUpdate, + type GristRecord_PersonalGoals, + type HA_Update, + type HomeAssistantEntity, + StatusComponent, + type TidalGetCurrent, } from "@dpu/shared"; import type { FastifyInstance, FastifyReply } from "fastify"; import type { FastifyRequest } from "fastify/types/request.js"; diff --git a/src/homepage/service.ts b/src/homepage/service.ts index 1d9aec0..f6dcd00 100644 --- a/src/homepage/service.ts +++ b/src/homepage/service.ts @@ -73,19 +73,14 @@ export class HomepageService extends BaseService { async sendFullInformationToSocket(socket: WebSocket): Promise { try { + const [desk, temp, tidal, personal_goals] = await this._getAll(); const updates: ComponentUpdate[] = [ - createComponentUpdate( - StatusComponent.HA_DESK_POSITION, - this.lastPoll.ha_desk_position, - ), - createComponentUpdate(StatusComponent.HA_TEMP, this.lastPoll.ha_temp), - createComponentUpdate( - StatusComponent.TIDAL_CURRENT, - this.lastPoll.tidal_current, - ), + createComponentUpdate(StatusComponent.HA_DESK_POSITION, desk), + createComponentUpdate(StatusComponent.HA_TEMP, temp), + createComponentUpdate(StatusComponent.TIDAL_CURRENT, tidal), createComponentUpdate( StatusComponent.GRIST_PERSONAL_GOALS, - this.lastPoll.grist_personal_goals, + personal_goals, ), ]; socket.send( diff --git a/src/index.ts b/src/index.ts index 9d585f7..f9ce505 100644 --- a/src/index.ts +++ b/src/index.ts @@ -154,7 +154,6 @@ const hpService = new HomepageService( wsService, ); -await hpService.getFullInformation(); hpService.scheduleMidnightGristUpdate(); async function verifyAPIKey(