This commit is contained in:
Darius
2026-02-10 09:53:52 +01:00
parent 37d3e2ede4
commit 908350f696
3 changed files with 11 additions and 17 deletions

View File

@@ -1,10 +1,10 @@
import { import {
StatusComponent, type ComponentUpdate,
type ComponentUpdate, type GristRecord_PersonalGoals,
type GristRecord_PersonalGoals, type HA_Update,
type HA_Update, type HomeAssistantEntity,
type HomeAssistantEntity, StatusComponent,
type TidalGetCurrent, type TidalGetCurrent,
} from "@dpu/shared"; } from "@dpu/shared";
import type { FastifyInstance, FastifyReply } from "fastify"; import type { FastifyInstance, FastifyReply } from "fastify";
import type { FastifyRequest } from "fastify/types/request.js"; import type { FastifyRequest } from "fastify/types/request.js";

View File

@@ -73,19 +73,14 @@ export class HomepageService extends BaseService<null> {
async sendFullInformationToSocket(socket: WebSocket): Promise<void> { async sendFullInformationToSocket(socket: WebSocket): Promise<void> {
try { try {
const [desk, temp, tidal, personal_goals] = await this._getAll();
const updates: ComponentUpdate[] = [ const updates: ComponentUpdate[] = [
createComponentUpdate( createComponentUpdate(StatusComponent.HA_DESK_POSITION, desk),
StatusComponent.HA_DESK_POSITION, createComponentUpdate(StatusComponent.HA_TEMP, temp),
this.lastPoll.ha_desk_position, createComponentUpdate(StatusComponent.TIDAL_CURRENT, tidal),
),
createComponentUpdate(StatusComponent.HA_TEMP, this.lastPoll.ha_temp),
createComponentUpdate(
StatusComponent.TIDAL_CURRENT,
this.lastPoll.tidal_current,
),
createComponentUpdate( createComponentUpdate(
StatusComponent.GRIST_PERSONAL_GOALS, StatusComponent.GRIST_PERSONAL_GOALS,
this.lastPoll.grist_personal_goals, personal_goals,
), ),
]; ];
socket.send( socket.send(

View File

@@ -154,7 +154,6 @@ const hpService = new HomepageService(
wsService, wsService,
); );
await hpService.getFullInformation();
hpService.scheduleMidnightGristUpdate(); hpService.scheduleMidnightGristUpdate();
async function verifyAPIKey( async function verifyAPIKey(