bendavid / aiopylgtv

Library to control webOS based LG Tv devices
MIT License
143 stars 47 forks source link

Exception when TV is switched into standby mode #47

Closed thecode closed 2 years ago

thecode commented 2 years ago

This exception happens when the TV is turned off, might be related that I have disabled the Quick Start+ feature,

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiopylgtv/webos_client.py", line 340, in ping_handler
    ping_waiter = await ws.ping()
  File "/usr/local/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 657, in ping
    await self.ensure_open()
  File "/usr/local/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 735, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedOK: code = 1001 (going away), reason = server shutting down

The exception needs to be caught here: https://github.com/bendavid/aiopylgtv/blob/6b676ea69cb77f4e363d8fc5934cc126d07ad537/aiopylgtv/webos_client.py#L356-L359 I can make a PR to fix it if there is a plan to make a new release.

chros73 commented 2 years ago

This one is also done, thanks.