allow to redefine homeassistant autodiscovery entity "type" and "object_id" (#4593)

* Add link for creating frontend issues. #4568

* allow to redefine entity type and object_id in homeassistant autodiscovery

Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
This commit is contained in:
Marco Massarotto
2020-10-08 19:38:25 +02:00
committed by GitHub
co-authored by Koen Kanters
parent 667bc42bee
commit bc7a436241
+1 -1
View File
@@ -1675,7 +1675,6 @@ class HomeAssistant extends Extension {
const friendlyName = resolvedEntity.settings.friendlyName;
this.getConfigs(resolvedEntity).forEach((config) => {
const topic = this.getDiscoveryTopic(config, device);
const payload = {...config.discovery_payload};
let stateTopic = `${settings.get().mqtt.base_topic}/${friendlyName}`;
if (payload.state_topic_postfix) {
@@ -1842,6 +1841,7 @@ class HomeAssistant extends Extension {
}
}
const topic = this.getDiscoveryTopic(config, device);
this.mqtt.publish(topic, stringify(payload), {retain: true, qos: 0}, this.discoveryTopic);
});