test
This commit is contained in:
@@ -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";
|
||||||
|
|||||||
@@ -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(
|
||||||
|
|||||||
@@ -154,7 +154,6 @@ const hpService = new HomepageService(
|
|||||||
wsService,
|
wsService,
|
||||||
);
|
);
|
||||||
|
|
||||||
await hpService.getFullInformation();
|
|
||||||
hpService.scheduleMidnightGristUpdate();
|
hpService.scheduleMidnightGristUpdate();
|
||||||
|
|
||||||
async function verifyAPIKey(
|
async function verifyAPIKey(
|
||||||
|
|||||||
Reference in New Issue
Block a user