-
Notifications
You must be signed in to change notification settings - Fork 222
Description
Hey,
I'm using tinytuya
from a Swift codebase (via PythonKit
) to interact with a set of Tuya devices via a native macOS app. Works really well 🎉
However, sometimes the app completely stalls waiting on a network request when a device is no longer discoverable on the network. For example, I'm seeing this in BulbDevice.heartbeat
, even with nowait: true
. It's not always reproducible, but often I come back to the app after it's been running for a few hours and have switched network, and the main thread is completely stuck inside heartbeat
. Sometimes, if I switch back to the Tuya wifi network, the app will spring back to life, presumably because the devices are now discoverable.
Any idea how I can have these methods more gracefully fail if a device is not detected, rather than hanging indefinitely?