mirror of
https://github.com/esphome/esphome.git
synced 2024-11-21 22:48:10 +01:00
Fix MQTT discovery enabled when discovery_retain in config (#131)
This commit is contained in:
parent
cf264a2743
commit
0fa52d0ce6
1 changed files with 1 additions and 1 deletions
|
@ -100,7 +100,7 @@ def to_code(config):
|
||||||
mqtt = Pvariable(config[CONF_ID], rhs)
|
mqtt = Pvariable(config[CONF_ID], rhs)
|
||||||
if not config.get(CONF_DISCOVERY, True):
|
if not config.get(CONF_DISCOVERY, True):
|
||||||
add(mqtt.disable_discovery())
|
add(mqtt.disable_discovery())
|
||||||
if CONF_DISCOVERY_RETAIN in config or CONF_DISCOVERY_PREFIX in config:
|
elif CONF_DISCOVERY_RETAIN in config or CONF_DISCOVERY_PREFIX in config:
|
||||||
discovery_retain = config.get(CONF_DISCOVERY_RETAIN, True)
|
discovery_retain = config.get(CONF_DISCOVERY_RETAIN, True)
|
||||||
discovery_prefix = config.get(CONF_DISCOVERY_PREFIX, 'homeassistant')
|
discovery_prefix = config.get(CONF_DISCOVERY_PREFIX, 'homeassistant')
|
||||||
add(mqtt.set_discovery_info(discovery_prefix, discovery_retain))
|
add(mqtt.set_discovery_info(discovery_prefix, discovery_retain))
|
||||||
|
|
Loading…
Reference in a new issue