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

@@ -236,6 +236,12 @@ class HomeAssistant(object):
"""Track tasks so you can wait for all tasks to be done."""
self.async_add_job = self._async_add_job_tracking
@asyncio.coroutine
def async_stop_track_tasks(self):
"""Track tasks so you can wait for all tasks to be done."""
yield from self.async_block_till_done()
self.async_add_job = self._async_add_job
@callback
def async_run_job(self, target: Callable[..., None], *args: Any) -> None:
"""Run a job from within the event loop.