Skip to content

Commit 07c2f2f

Browse files
committed
fix module context starting before Home Assistant; see #784
1 parent 9baf48b commit 07c2f2f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

custom_components/pyscript/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def start_global_contexts(global_ctx_only: str = None) -> None:
133133
start_list = []
134134
for global_ctx_name, global_ctx in GlobalContextMgr.items():
135135
idx = global_ctx_name.find(".")
136-
if idx < 0 or global_ctx_name[0:idx] not in {"file", "apps", "scripts"}:
136+
if idx < 0 or global_ctx_name[0:idx] not in {"file", "apps", "modules", "scripts"}:
137137
continue
138138
if global_ctx_only is not None and global_ctx_only != "*":
139139
if global_ctx_name != global_ctx_only and not global_ctx_name.startswith(global_ctx_only + "."):

custom_components/pyscript/global_ctx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def find_first_file(file_paths: List[Set[str]]) -> List[Optional[Union[str, Modu
188188
global_ctx = GlobalContext(
189189
ctx_name, global_sym_table=mod.__dict__, manager=self.manager, rel_import_path=rel_import_path
190190
)
191-
global_ctx.set_auto_start(True)
191+
global_ctx.set_auto_start(self.auto_start)
192192
_, error_ctx = await self.manager.load_file(global_ctx, file_path)
193193
if error_ctx:
194194
_LOGGER.error(

0 commit comments

Comments
 (0)