Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LG WebOS TV Python 3.10 fails to setup component #60064

Closed
slackr31337 opened this issue Nov 21, 2021 · 3 comments
Closed

LG WebOS TV Python 3.10 fails to setup component #60064

slackr31337 opened this issue Nov 21, 2021 · 3 comments

Comments

@slackr31337
Copy link
Contributor

The problem

WebOSTV fails to setup

What version of Home Assistant Core has the issue?

2021.11.5

What was the last working version of Home Assistant Core?

core-2021.10.x

What type of installation are you running?

Home Assistant Core

Integration causing the issue

WebOSTV

Link to integration documentation on our website

https://www.home-assistant.io/integrations/webostv/

Example YAML snippet

webostv:
  - name: Family Room TV
    host: 10.x.x.101
    turn_on_action:
      service: wake_on_lan.send_magic_packet
      data:
        mac: xx:xx:xx:xx:xx:xx

  - name: Living Room TV
    host: 10.x.x.100
    turn_on_action:
      service: wake_on_lan.send_magic_packet
      data:
        mac: xx:xx:xx:xx:xx:xx

Anything in the logs that might be useful for us?

Nov 20 20:06:38 home-assistant hass[501273]: 2021-11-20 20:06:38 ERROR (MainThread) [homeassistant.setup] Error during setup of component webostv
Nov 20 20:06:38 home-assistant hass[501273]: Traceback (most recent call last):
Nov 20 20:06:38 home-assistant hass[501273]:   File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/setup.py", line 254, in _async_setup_component
Nov 20 20:06:38 home-assistant hass[501273]:     result = await task
Nov 20 20:06:38 home-assistant hass[501273]:   File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/components/webostv/__init__.py", line 103, in async_setup
Nov 20 20:06:38 home-assistant hass[501273]:     await asyncio.gather(*tasks)
Nov 20 20:06:38 home-assistant hass[501273]:   File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/components/webostv/__init__.py", line 146, in async_setup_tv
Nov 20 20:06:38 home-assistant hass[501273]:     await async_setup_tv_finalize(hass, config, conf, client)
Nov 20 20:06:38 home-assistant hass[501273]:   File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/components/webostv/__init__.py", line 176, in async_setup_tv_finalize
Nov 20 20:06:38 home-assistant hass[501273]:     await async_connect(client)
Nov 20 20:06:38 home-assistant hass[501273]:   File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/components/webostv/__init__.py", line 163, in async_connect
Nov 20 20:06:38 home-assistant hass[501273]:     await client.connect()
Nov 20 20:06:38 home-assistant hass[501273]:   File "/srv/homeassistant/lib/python3.10/site-packages/aiopylgtv/webos_client.py", line 152, in connect
Nov 20 20:06:38 home-assistant hass[501273]:     return await self.connect_result
Nov 20 20:06:38 home-assistant hass[501273]:   File "/srv/homeassistant/lib/python3.10/site-packages/aiopylgtv/webos_client.py", line 180, in connect_handler
Nov 20 20:06:38 home-assistant hass[501273]:     ws = await asyncio.wait_for(
Nov 20 20:06:38 home-assistant hass[501273]:   File "/usr/local/lib/python3.10/asyncio/tasks.py", line 447, in wait_for
Nov 20 20:06:38 home-assistant hass[501273]:     return fut.result()
Nov 20 20:06:38 home-assistant hass[501273]:   File "/usr/local/lib/python3.10/asyncio/tasks.py", line 648, in _wrap_awaitable
Nov 20 20:06:38 home-assistant hass[501273]:     return (yield from awaitable.__await__())
Nov 20 20:06:38 home-assistant hass[501273]:   File "/srv/homeassistant/lib/python3.10/site-packages/websockets/legacy/client.py", line 622, in __await_impl__
Nov 20 20:06:38 home-assistant hass[501273]:     transport, protocol = await self._create_connection()
Nov 20 20:06:38 home-assistant hass[501273]:   File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1080, in create_connection
Nov 20 20:06:38 home-assistant hass[501273]:     transport, protocol = await self._create_connection_transport(
Nov 20 20:06:38 home-assistant hass[501273]:   File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1098, in _create_connection_transport
Nov 20 20:06:38 home-assistant hass[501273]:     protocol = protocol_factory()
Nov 20 20:06:38 home-assistant hass[501273]:   File "/srv/homeassistant/lib/python3.10/site-packages/websockets/legacy/client.py", line 160, in __init__
Nov 20 20:06:38 home-assistant hass[501273]:     super().__init__(**kwargs)
Nov 20 20:06:38 home-assistant hass[501273]:   File "/srv/homeassistant/lib/python3.10/site-packages/websockets/legacy/protocol.py", line 154, in __init__
Nov 20 20:06:38 home-assistant hass[501273]:     self._drain_lock = asyncio.Lock(
Nov 20 20:06:38 home-assistant hass[501273]:   File "/usr/local/lib/python3.10/asyncio/locks.py", line 77, in __init__
Nov 20 20:06:38 home-assistant hass[501273]:     super().__init__(loop=loop)
Nov 20 20:06:38 home-assistant hass[501273]:   File "/usr/local/lib/python3.10/asyncio/mixins.py", line 17, in __init__
Nov 20 20:06:38 home-assistant hass[501273]:     raise TypeError(
Nov 20 20:06:38 home-assistant hass[501273]: TypeError: As of 3.10, the *loop* parameter was removed from Lock() since it is no longer necessary

Additional information

Just updated to Python 3.10 from 3.8

@probot-home-assistant
Copy link

Hey there @bendavid, @thecode, mind taking a look at this issue as it has been labeled with an integration (webostv) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)


webostv documentation
webostv source
(message by IssueLinks)

@slackr31337
Copy link
Contributor Author

Looks like an issue in websockets 9.x and fixed in 10.1.

python-websockets/websockets#936

(homeassistant) homeassistant@home-assistant:/srv/homeassistant$ pip3 install --upgrade websockets
Collecting websockets
Downloading websockets-10.1.tar.gz (83 kB)
|████████████████████████████████| 83 kB 771 kB/s
Using legacy 'setup.py install' for websockets, since package 'wheel' is not installed.
Installing collected packages: websockets
Attempting uninstall: websockets
Found existing installation: websockets 9.1
Uninstalling websockets-9.1:
Successfully uninstalled websockets-9.1
Running setup.py install for websockets ... done
Successfully installed websockets-10.1

The WebOSTV component setup after updating websockets to 10.1

@frenck
Copy link
Member

frenck commented Nov 22, 2021

Thanks @slackr31337 👍

Just a small little note: We don't support Python 3.10 yet (but good we have this as an issue logged!).

@github-actions github-actions bot added the stale label Dec 22, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants