add better sse handling

This commit is contained in:
Darius
2026-02-05 04:34:14 +01:00
parent 4db61998bd
commit 0043b75c95
4 changed files with 37 additions and 14 deletions

View File

@@ -23,6 +23,7 @@ import { sseRoutes } from "./sse/routes.js";
import { SseService } from "@dpu/shared";
import { HomepageService } from "./homepage/service.js";
import { homepageRoutes } from "./homepage/routes.js";
import fastifySSE from "@fastify/sse";
const fastify = Fastify().withTypeProvider<ZodTypeProvider>();
@@ -73,6 +74,8 @@ await fastify.register(fastifyAxios, {
},
});
await fastify.register(fastifySSE);
const haClient = new HomeAssistantClient(fastify.axios.homeassistant);
const haService = new HomeAssistantService(haClient);