schema update
This commit is contained in:
@@ -24,7 +24,6 @@ export async function homeAssistantRoutes(
|
|||||||
tags: ["homeassistant"],
|
tags: ["homeassistant"],
|
||||||
response: {
|
response: {
|
||||||
200: z.object({
|
200: z.object({
|
||||||
position: z.string(),
|
|
||||||
is_standing: z.boolean(),
|
is_standing: z.boolean(),
|
||||||
last_changed: z.string(),
|
last_changed: z.string(),
|
||||||
last_changed_seconds: z.number(),
|
last_changed_seconds: z.number(),
|
||||||
|
|||||||
@@ -56,11 +56,6 @@ export class HomeAssistantService extends BaseService<HomeAssistantClient> {
|
|||||||
const result = {
|
const result = {
|
||||||
raw,
|
raw,
|
||||||
as_boolean: position === 1,
|
as_boolean: position === 1,
|
||||||
as_text: () => {
|
|
||||||
if (position === 1) return "standing";
|
|
||||||
if (position === 0) return "sitting";
|
|
||||||
return "unknown";
|
|
||||||
},
|
|
||||||
last_changed: calculateSecondsBetween(
|
last_changed: calculateSecondsBetween(
|
||||||
new Date(raw.last_changed).getTime(),
|
new Date(raw.last_changed).getTime(),
|
||||||
Date.now(),
|
Date.now(),
|
||||||
|
|||||||
Reference in New Issue
Block a user