-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Expose running tasks to scripts #130
Comments
I like the idea of having some helper methods to dig deeper into the running state of pyscript. In the mean time, for the scenario you describe above,
|
In issue #112 we recently added some I like your suggestions of adding a few more helper functions. I was thinking of something like this:
I don't think it makes sense to return tasks that haven't named themselves via |
As I am adding long running tasks (in the like dim light wait 5 minutes dim some more), I find it that other tasks may need to know about what is currently running and act accordingly (even more so with more complex automations). For a sample scenario:
Currently this means that task 1 may dim the lights. After door opens and the lights turn off the task 1 will resume and turn on the lights. In this case it will be useful to expose running tasks (preferably named ones) and be able to cancel them.
I am currently simply augmenting the functions.py to add the following snippet
This rough-in seems to do the job and I am able to list currently running task with some caveats:
x
minutes I have to add a task.sleep forx
minutesThe text was updated successfully, but these errors were encountered: