mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 10:59:40 +00:00
Convert mqtt platforms to async (#6145)
* Convert mqtt platforms to async * fix lint * add more platforms * convert mqtt_eventstream * fix lint / add mqtt_room * fix lint * fix test part 1 * fix test part 2 * fix out of memory bug * address comments
This commit is contained in:
@@ -62,7 +62,8 @@ def is_on(hass, entity_id):
|
||||
|
||||
def turn_on(hass, entity_id):
|
||||
"""Reset the alert."""
|
||||
run_callback_threadsafe(hass.loop, async_turn_on, hass, entity_id)
|
||||
run_callback_threadsafe(
|
||||
hass.loop, async_turn_on, hass, entity_id).result()
|
||||
|
||||
|
||||
@callback
|
||||
@@ -75,7 +76,8 @@ def async_turn_on(hass, entity_id):
|
||||
|
||||
def turn_off(hass, entity_id):
|
||||
"""Acknowledge alert."""
|
||||
run_callback_threadsafe(hass.loop, async_turn_off, hass, entity_id)
|
||||
run_callback_threadsafe(
|
||||
hass.loop, async_turn_off, hass, entity_id).result()
|
||||
|
||||
|
||||
@callback
|
||||
|
||||
Reference in New Issue
Block a user