FreshlyBrewedCode / pymee

a python library to interact with homee
MIT License
8 stars 4 forks source link

Fix failure to reconnect on remote disconnect #4

Closed r4nt closed 1 year ago

r4nt commented 1 year ago

When the connection drops, the pong_waiter task can be already done when ws.abort_pings() is called, leading to an InvalidStateError as abort_pings() is unconditionally calling set_exception on the pong_waiter. If that exception is not caught, we're falling outside the recovery loop and do not reconnect. To fix this, put a try block around ws.abort_pings().

FreshlyBrewedCode commented 1 year ago

Thanks!