Make automation async

This commit is contained in:
Paulus Schoutsen 2016-10-01 01:22:13 -07:00
parent 16ff68ca84
commit 7ab7edd81c
19 changed files with 205 additions and 346 deletions

View file

@ -22,7 +22,7 @@ TRIGGER_SCHEMA = vol.Schema({
})
def trigger(hass, config, action):
def async_trigger(hass, config, action):
"""Listen for state changes based on configuration."""
topic = config.get(CONF_TOPIC)
payload = config.get(CONF_PAYLOAD)
@ -40,4 +40,4 @@ def trigger(hass, config, action):
}
})
return mqtt.subscribe(hass, topic, mqtt_automation_listener)
return mqtt.async_subscribe(hass, topic, mqtt_automation_listener)