Skip to content

Commit

Permalink
fix(home-assistant): use correct instance status topic for local enti…
Browse files Browse the repository at this point in the history
…ties
  • Loading branch information
mKeRix committed May 30, 2021
1 parent b5a7de3 commit 9199fcd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/integrations/home-assistant/home-assistant.service.ts
Expand Up @@ -367,12 +367,12 @@ export class HomeAssistantService

config.distributed = entity.distributed;
config.stateLocked = entity.stateLocked;
config.setInstanceStatusTopic(
`${INSTANCE_STATUS_BASE_TOPIC}/${
this.clusterService.leader()?.id ||
this.configService.get('global').instanceName
}`
);

const instanceId = makeId(this.configService.get('global').instanceName);
const leaderId = entity.distributed
? this.clusterService.leader()?.id
: instanceId;
config.setInstanceStatusTopic(`${INSTANCE_STATUS_BASE_TOPIC}/${leaderId}`);

return config;
}
Expand Down

0 comments on commit 9199fcd

Please sign in to comment.