We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 01d752d commit cd87d2eCopy full SHA for cd87d2e
custom_components/pyscript/__init__.py
@@ -179,6 +179,8 @@ async def stop_triggers(event):
179
if not global_ctx_name.startswith("file."):
180
continue
181
global_ctx.stop()
182
+ # tell reaper task to exit (after other tasks are cancelled)
183
+ Function.task_cancel(None)
184
185
hass.bus.async_listen(EVENT_HOMEASSISTANT_STARTED, start_triggers)
186
hass.bus.async_listen(EVENT_HOMEASSISTANT_STOP, stop_triggers)
custom_components/pyscript/function.py
@@ -78,6 +78,8 @@ async def task_cancel_reaper(reaper_q):
78
try:
79
80
task = await reaper_q.get()
81
+ if task is None:
82
+ return
83
task.cancel()
84
await task
85
except asyncio.CancelledError:
0 commit comments