jasonacox / tinytuya

Python API for Tuya WiFi smart devices using a direct local area network (LAN) connection or the cloud (TuyaCloud API).
MIT License
937 stars 167 forks source link

Allow nowait for status(), and split message parsing into separate function #253

Closed uzlonewolf closed 1 year ago

uzlonewolf commented 1 year ago

I have a single-threaded application where I handle the socket reading (via select.select() and buffering the data) and needed status() to not block. Once I get a message I then need to parse it, so I moved the parsing part of _send_receive() into its own function to make it easier to call.

jasonacox commented 1 year ago

Logical. I can't think of any dependency issue for this change so I will rev the version as a minor patch, v1.9.2.