File tree Expand file tree Collapse file tree 3 files changed +7
-1
lines changed
custom_components/pyscript Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ def start_global_contexts(global_ctx_only: str = None) -> None:
130130 idx = global_ctx_name .find ("." )
131131 if idx < 0 or global_ctx_name [0 :idx ] not in {"file" , "apps" , "scripts" }:
132132 continue
133- if global_ctx_only is not None :
133+ if global_ctx_only is not None and global_ctx_only != "*" :
134134 if global_ctx_name != global_ctx_only and not global_ctx_name .startswith (global_ctx_only + "." ):
135135 continue
136136 global_ctx .set_auto_start (True )
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ Breaking changes since 1.2.1 include:
5252Bug fixes since 1.2.1 include:
5353
5454- Fixed ``@state_trigger `` with only a ``.old `` variable, which previously never triggered; reported by stigvi.
55+ - Reload with global_ctx="*" now starts triggers, reported by Fabio C.
5556- Fixed subscripts when running python 3.9.x.
5657- Timeouts that implement time triggers might infrequenctly occur a tiny time before the target time. A fix was added
5758 to do an additional short timeout when there is an early timeout, to make sure any time trigger occurs at or shortly
Original file line number Diff line number Diff line change @@ -47,6 +47,10 @@ def func1():
4747@service
4848def func2():
4949 pass
50+
51+ @time_trigger
52+ def startup():
53+ log.info(f"{__name__} is starting up")
5054""" ,
5155 #
5256 # This will load, since there is an apps/world2 config entry
@@ -266,6 +270,7 @@ def shutdown(trigger_time=None):
266270 #
267271 for i in range (3 ):
268272 assert caplog .text .count ("world global_ctx=apps.world xyz=" ) == 2 + i
273+ assert caplog .text .count ("world is starting up" ) == 2 + i
269274 assert caplog .text .count ("world2 global_ctx=apps.world2 var1=" ) == 3 + i
270275 assert caplog .text .count ("hello global_ctx=file.hello xyz=" ) == 4 + i
271276 assert caplog .text .count ("modules/xyz2/other global_ctx=modules.xyz2.other" ) == 2 + i
You can’t perform that action at this time.
0 commit comments