Skip to content

Commit 88496cf

Browse files
committed
set global context auto_start to True after reload so new trigger closures get started
1 parent 2aaac02 commit 88496cf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

custom_components/pyscript/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,10 @@ async def reload_scripts_handler(call):
9797
await load_scripts(hass)
9898

9999
for global_ctx_name, global_ctx in GlobalContextMgr.items():
100-
if not global_ctx_name.startswith("file."):
100+
idx = global_ctx_name.find(".")
101+
if idx < 0 or global_ctx_name[0:idx] not in {"file", "apps"}:
101102
continue
103+
global_ctx.set_auto_start(True)
102104
global_ctx.start()
103105

104106
hass.services.async_register(DOMAIN, SERVICE_RELOAD, reload_scripts_handler)

0 commit comments

Comments
 (0)