Skip to content

Commit

Permalink
set global context auto_start to True after reload so new trigger clo…
Browse files Browse the repository at this point in the history
…sures get started
  • Loading branch information
craigbarratt committed Sep 30, 2020
1 parent 2aaac02 commit 88496cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion custom_components/pyscript/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ async def reload_scripts_handler(call):
await load_scripts(hass)

for global_ctx_name, global_ctx in GlobalContextMgr.items():
if not global_ctx_name.startswith("file."):
idx = global_ctx_name.find(".")
if idx < 0 or global_ctx_name[0:idx] not in {"file", "apps"}:
continue
global_ctx.set_auto_start(True)
global_ctx.start()

hass.services.async_register(DOMAIN, SERVICE_RELOAD, reload_scripts_handler)
Expand Down

0 comments on commit 88496cf

Please sign in to comment.