how to avoid launching a duplicate process with task.executor() #267
-
Hello, I am launching a .py program in HASS with The issue is that I'd like to check whether the task is already running and not launch a second duplicate process. Is there a way to check that? Thank you. |
Beta Was this translation helpful? Give feedback.
Answered by
craigbarratt
Nov 18, 2021
Replies: 1 comment 3 replies
-
You could consider wrapping it in a function that you call with |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
paulius2k
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You could consider wrapping it in a function that you call with
task.create()
. That function would calltask.unique()
then task.excutor(). Calling that function multiple times viatask.create()
will have no effect if one already exists. You could also usetask.name2id()
to check if the task exists.