From 6781619b7af4b2673f32e22a3b8bc084a170f3ae Mon Sep 17 00:00:00 2001 From: Heiko Rothe Date: Sun, 30 May 2021 18:28:44 +0200 Subject: [PATCH] fix(home-assistant): use consistent id for instance availability We need to match the behavior of the ClusterService to make it work correctly across the cluster. Apart from that the instance name could technically also contain characters that aren't valid for MQTT topic names, so turning it into an ID like we do everywhere else isn't a bad idea in general. For more info check the later posts in #728. --- src/integrations/home-assistant/home-assistant.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/integrations/home-assistant/home-assistant.service.ts b/src/integrations/home-assistant/home-assistant.service.ts index 8fae92b..7baec07 100644 --- a/src/integrations/home-assistant/home-assistant.service.ts +++ b/src/integrations/home-assistant/home-assistant.service.ts @@ -69,7 +69,7 @@ export class HomeAssistantService this.config = this.configService.get('homeAssistant'); const instanceName = this.configService.get('global').instanceName; - this.statusTopic = `${INSTANCE_STATUS_BASE_TOPIC}/${instanceName}`; + this.statusTopic = `${INSTANCE_STATUS_BASE_TOPIC}/${makeId(instanceName)}`; } /**