Make automation async
This commit is contained in:
parent
16ff68ca84
commit
7ab7edd81c
19 changed files with 205 additions and 346 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue