From 81828ecfe6277b850a188ddbc6372cde43458e81 Mon Sep 17 00:00:00 2001 From: Felipe Santos Date: Fri, 8 Nov 2024 12:27:18 -0300 Subject: [PATCH] Auto-discover Home Assistant when running inside an add-on --- src/language-service/src/configuration.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/language-service/src/configuration.ts b/src/language-service/src/configuration.ts index b81e74ed27..49ffc37aea 100644 --- a/src/language-service/src/configuration.ts +++ b/src/language-service/src/configuration.ts @@ -54,6 +54,10 @@ export class ConfigurationService implements IConfigurationService { if (!this.token && process.env.HASS_TOKEN) { this.token = process.env.HASS_TOKEN; } + if (!this.url && !this.token && process.env.SUPERVISOR_TOKEN) { + this.url = this.getUri("http://supervisor/core"); + this.token = process.env.SUPERVISOR_TOKEN; + } } private getUri = (value: string): string => {