Skip to content

Commit

Permalink
Set background_task status when executing runtime tasks (#2188)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus authored Aug 29, 2021
1 parent 2f8e906 commit 3356f63
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions custom_components/hacs/tasks/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@ def get(self, slug: str) -> HacsTask | None:

async def async_execute_runtume_tasks(self) -> None:
"""Execute the the execute methods of each runtime task if the stage matches."""
self.hacs.status.background_task = True
await asyncio.gather(
*(
task.execute_task()
for task in self.tasks
if task.stages is not None and self.hacs.stage in task.stages
)
)
self.hacs.status.background_task = False

0 comments on commit 3356f63

Please sign in to comment.