Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

time_trigger once / trigger_time #762

Unanswered
melmager asked this question in Q&A
Discussion options

I calculate a time elsewhere when a function should be executed
I see two possibilities
"once(datetime)" but then I would have to control datetime via a variable (state_persist?) - is that possible
Or
I go over trigger_time and compare with the desired time at a @time_trigger - but I'm unclear how to get trigger_time

You must be logged in to vote

Replies: 2 comments 1 reply

Comment options

Can you please add code examples to your question? Both variants.

You must be logged in to vote
0 replies
Comment options

There are several options, eg:

  • dynamic (ie, run-time computed) trigger time can be handled with a closure (ie, a dynamically created trigger function). See the docs.
  • inside a running task, you can call task.wait_until(). See the docs.
You must be logged in to vote
1 reply
Comment options

wait ist not a option :-)
but clocure helps :-)
so
@time_trigger("once({pyscript.my_time}") - i will try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /