-
I've noticed that during HASS startup, In my I can mitigate this issue for HASS startup specifically by putting the initialization code in a function decorated with Is there a way to get the best of both worlds--i.e., if HASS is starting up, have the function hold until everything has initialized, but otherwise to just run the function if the app has been reloaded? I don't think I can wait-with-timeout for a start event from HASS, because the event probably won't be sent until pyscript finishes initializing, and that won't happen until my My fallback will be to delay handling nonexistent entities until they are actually used, but I was hoping to do a little better so that I can catch typos made when editing configuration when the typos are made, rather than some time possibly much later. Thanks in advance for any ideas you consider sharing. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The better way is @time_trigger
def tryout(trigger_type=None, var_name=None, value=None, old_value=None, context=None, **kwargs):
log.debug("this will trigger every time this file changes") via https://hacs-pyscript.readthedocs.io/en/stable/reference.html#time-trigger |
Beta Was this translation helpful? Give feedback.
The better way is
@time_trigger
.via https://hacs-pyscript.readthedocs.io/en/stable/reference.html#time-trigger