sbidy / pywizlight

A python connector for WiZ devices
MIT License
463 stars 79 forks source link

Fix a race condition in bulb.py when closing while a bulb is offline #168

Closed tjmv closed 5 months ago

tjmv commented 1 year ago

When restarting Home Assistant, an error is thrown when bulbs are offline.

Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/pywizlight/bulb.py", line 379, in _send_udp_message_with_retry if transport.is_closing() or response_future.done(): ^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'is_closing'