sbidy / pywizlight

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

Async issue with in discovery class #13

Closed sbidy closed 2 years ago

sbidy commented 4 years ago

Exception if discover class is called. Workaround in 0.3.4 but not finally fixed.

https://github.com/sbidy/pywizlight/blob/0f5a32130a8f0d2f019ac18f488fcc67e2e70532/pywizlight/bulb.py#L359

Exception in callback discovery.BroadcastProtocol.broadcast_registration()
handle: <TimerHandle when=166638.781 discovery.BroadcastProtocol.broadcast_registration()>
Traceback (most recent call last):
    self._sock.sendto(data, addr)
AttributeError: 'NoneType' object has no attribute 'sendto'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Stephan\AppData\Local\Programs\Python\Python37-32\lib\asyncio\events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Users\Stephan\Documents\GitHub\pywizlight\pywizlight\bulb.py", line 363, in broadcast_registration
    register_method.encode(), ("255.255.255.255", 38899)
  File "C:\Users\Stephan\AppData\Local\Programs\Python\Python37-32\lib\asyncio\selector_events.py", line 1007, in sendto
    exc, 'Fatal write error on datagram transport')
  File "C:\Users\Stephan\AppData\Local\Programs\Python\Python37-32\lib\asyncio\selector_events.py", line 675, in _fatal_error
    self._loop.call_exception_handler({
AttributeError: 'NoneType' object has no attribute 'call_exception_handler'
sbidy commented 3 years ago

... das wird nie gefixed 😉

bdraco commented 2 years ago

This shouldn't be possible anymore