1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Finish all tasks before setup phase is done (#4606)

This commit is contained in:
Paulus Schoutsen
2016-11-30 13:02:45 -08:00
committed by GitHub
parent 71da9d2f50
commit b35fa4f1c1
4 changed files with 65 additions and 2 deletions

View File

@@ -365,6 +365,7 @@ def async_from_config_dict(config: Dict[str, Any],
Dynamically loads required components and its dependencies.
This method is a coroutine.
"""
hass.async_track_tasks()
setup_lock = hass.data.get('setup_lock')
if setup_lock is None:
setup_lock = hass.data['setup_lock'] = asyncio.Lock(loop=hass.loop)
@@ -427,6 +428,8 @@ def async_from_config_dict(config: Dict[str, Any],
setup_lock.release()
yield from hass.async_stop_track_tasks()
return hass