add seconds to standing/sitting time

This commit is contained in:
Darius
2026-02-05 22:53:56 +01:00
parent 7b6a056141
commit 07719bbc1f
3 changed files with 94 additions and 90 deletions

4
package-lock.json generated
View File

@@ -26,8 +26,8 @@
}
},
"node_modules/@dpu/shared": {
"version": "1.6.2",
"resolved": "git+https://git.dariusbag.dev/DarDarBinks/dpu-shared.git#ceadd4e5a2db3e94234a455d66338fb94fccea40",
"version": "1.6.4",
"resolved": "git+https://git.dariusbag.dev/DarDarBinks/dpu-shared.git#60bcd23f5b77034777a792bbe8f33a62e92ba246",
"dependencies": {
"axios": "^1.7.9",
"chalk": "^5.6.2",

View File

@@ -27,6 +27,7 @@ export async function homeAssistantRoutes(
position: z.string(),
is_standing: z.boolean(),
last_changed: z.string(),
last_changed_seconds: z.number(),
}),
418: z.object({
error: z.string(),
@@ -42,7 +43,9 @@ export async function homeAssistantRoutes(
return { error: service_result.result };
}
return haService.convertPosResultToApiAnswer(service_result.result as HomeAssistantDeskPositionResult);
return haService.convertPosResultToApiAnswer(
service_result.result as HomeAssistantDeskPositionResult,
);
},
);

View File

@@ -82,6 +82,7 @@ export class HomeAssistantService extends BaseService<HomeAssistantClient> {
position: position.as_text(),
is_standing: position.as_boolean,
last_changed: position.last_changed.toReadable(true),
last_changed_seconds: position.last_changed.seconds,
};
}