custom-components / pyscript

Pyscript adds rich Python scripting to HASS
Apache License 2.0
894 stars 47 forks source link

@task_unique decorator not working along with @service decorator #629

Open idogrf opened 2 months ago

idogrf commented 2 months ago

Hi, minor issue - maybe it's known

I'm trying to define a service with a @task_unique decorator for example -

@service
@task_unique('my_service', kill_me=True)
def my_service():
    log.info("Hi")
    task.sleep(10)

it doesn't work as expected and I can see multiple entries in the logs when calling the service several times

if I use task.unique() at the start of the service instead of the decorator it does work

not a major issue at all