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

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

No files matched your search

+3
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