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

ws4py changes have broken LGWebOSRemote #172

Open
sslupsky opened this issue Nov 2, 2024 · 2 comments
Open

ws4py changes have broken LGWebOSRemote #172

sslupsky opened this issue Nov 2, 2024 · 2 comments

Comments

@sslupsky
Copy link

sslupsky commented Nov 2, 2024

There was a recent change (well, 3 years ago but after the 0.5.1 release) to the ws4py repo and now something appears to be broken when LGWebOSRemote is installed related to asyncio. Encountered these two errors during installation:

  self.initialize_options()
  File "build/bdist.macosx-10.9-x86_64/egg/ws4py/async_websocket.py", line 87
    asyncio.async(closeit())
            ^
SyntaxError: invalid syntax

  File "build/bdist.macosx-10.9-x86_64/egg/ws4py/server/tulipserver.py", line 43
    f = asyncio.async(self.handle_initial_handshake())
                ^
SyntaxError: invalid syntax

Specifically, it appears the "future" has arrived related to this commit #b03d29b

The egg included with the install does not include these "unreleased" compatibility changes. I believe you need to update the version of ws4py included with the install.

@sslupsky
Copy link
Author

sslupsky commented Nov 2, 2024

Updating to the newer version of ws4py causes an error with websocket.py:

stevenslupsky@barbie-en0 LGWebOSRemote % ~/bin/lgtv auth 10.0.xxx.xxx OLED48C3 --ssl
Please accept the pairing request on your LG TV
{"closing": {"code": 1000, "reason": ""}}
Exception in thread WebSocketClient:
Traceback (most recent call last):
  File "/Users/stevenslupsky/.local/share/mise/installs/python/3.8.18/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/Users/stevenslupsky/.local/share/mise/installs/python/3.8.18/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/stevenslupsky/.local/share/mise/installs/python/3.8.18/lib/python3.8/site-packages/ws4py/websocket.py", line 528, in run
    if not self.once():
  File "/Users/stevenslupsky/.local/share/mise/installs/python/3.8.18/lib/python3.8/site-packages/ws4py/websocket.py", line 410, in once
    if not self.process(self.buf[:requested]):
  File "/Users/stevenslupsky/.local/share/mise/installs/python/3.8.18/lib/python3.8/site-packages/ws4py/websocket.py", line 465, in process
    logger.debug("Closing message received (%d): %s" % (s.closing.code, s.closing.reason.decode() if isinstance(s.closing.reason, bytes) else s.closing.reason))
TypeError: isinstance() arg 2 must be a type or tuple of types
Wrote config file: /Users/stevenslupsky/.lgtv/config.json

@vegeta0911
Copy link

Hi
It works if you make a python environment with python-env.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants