From e1ca9d896349fa869dbb12aca8dbdc67d68e48e8 Mon Sep 17 00:00:00 2001 From: Darius Date: Fri, 21 Nov 2025 20:57:17 +0100 Subject: [PATCH] Generic Commit; Most likely a fix or small feature --- src/homeassistant/service.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/homeassistant/service.ts b/src/homeassistant/service.ts index 0bcfd8f..d6e022c 100644 --- a/src/homeassistant/service.ts +++ b/src/homeassistant/service.ts @@ -21,10 +21,12 @@ export class HomeAssistantService extends BaseService { const position = positionResult.result as HomeAssistantDeskPositionResult; if (position.as_boolean) { - throw Error("desk is already in standing position"); + throw Error( + `desk is already in standing position and has been for ${position.last_changed.toReadable(true)}`, + ); } - if (position.last_changed.seconds < 120) { + if (position.last_changed.seconds < 300) { throw Error("desk has moved too recently"); } @@ -34,7 +36,7 @@ export class HomeAssistantService extends BaseService { return this.getSuccessfulResult(result); } catch (error) { - const error_message = `error starting stand automation. ${error}`; + const error_message = `error starting stand automation. ${error instanceof Error ? error.message : error}`; logWarning(error_message); return this.getErrorResult(error_message); }