codetheweb / tuyapi

🌧 An easy-to-use API for devices that use Tuya's cloud services. Documentation: https://codetheweb.github.io/tuyapi.
MIT License
2.07k stars 341 forks source link

Device Reconnect #554

Closed kraineff closed 5 days ago

kraineff commented 2 years ago

It would be nice to add an option in the constructor for Reconnect on "error" or "disconnected" states!

codetheweb commented 2 years ago

If you're using the event-based API I believe the current approach is to let you handle this yourself. I would be willing to accept a PR that attempts to reconnect after a disconnected event.