1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-15 07:08:20 +00:00

Fix MQTT message trigger (#282)

Fixes https://github.com/OttoWinter/esphomelib/issues/335
This commit is contained in:
Otto Winter 2019-01-02 12:29:29 +01:00 committed by GitHub
parent c90b1c25c0
commit 8a408fc0f5

View File

@ -173,7 +173,7 @@ def to_code(config):
add(mqtt.set_reboot_timeout(config[CONF_REBOOT_TIMEOUT]))
for conf in config.get(CONF_ON_MESSAGE, []):
rhs = mqtt.make_message_trigger(conf[CONF_TOPIC])
rhs = App.register_component(mqtt.make_message_trigger(conf[CONF_TOPIC]))
trigger = Pvariable(conf[CONF_TRIGGER_ID], rhs)
if CONF_QOS in conf:
add(trigger.set_qos(conf[CONF_QOS]))