pyscript equivalent to HA yaml "mode: queued" #478
-
I'm new to HA, and even newer to pyscript. I have one significant thing I can't find a pyscript solution for. I use the HA yaml "mode: queued" to ensure that only one HA action is telneting with one of my devices at any one time. It is simple to use. Is there a pyscript equivalent please ? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
First, you should be using To ensure your telnet I/O is serialized among multiple callers, you should use |
Beta Was this translation helpful? Give feedback.
First, you should be using
asynctelnet
instead of the vanillatelnet
module to avoid blocking.To ensure your telnet I/O is serialized among multiple callers, you should use
asyncio.Lock()
, or one of the other async synchronization primitives. See #340 for an example.