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); }