mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	Fix MQTT message trigger (#282)
Fixes https://github.com/OttoWinter/esphomelib/issues/335
This commit is contained in:
		| @@ -173,7 +173,7 @@ def to_code(config): | |||||||
|         add(mqtt.set_reboot_timeout(config[CONF_REBOOT_TIMEOUT])) |         add(mqtt.set_reboot_timeout(config[CONF_REBOOT_TIMEOUT])) | ||||||
|  |  | ||||||
|     for conf in config.get(CONF_ON_MESSAGE, []): |     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) |         trigger = Pvariable(conf[CONF_TRIGGER_ID], rhs) | ||||||
|         if CONF_QOS in conf: |         if CONF_QOS in conf: | ||||||
|             add(trigger.set_qos(conf[CONF_QOS])) |             add(trigger.set_qos(conf[CONF_QOS])) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user