cmer / lg-tv-control-macos

Automatically wake/sleep and change the input of your LG TV when used as a monitor on macOS
123 stars 12 forks source link

Can't pair TV KeyError: 'pairingType' #24

Closed SleeplessDesire closed 8 months ago

SleeplessDesire commented 8 months ago

I am getting a KeyError: 'pairingType' when attempting to pair my tv:

DEBUG:getmac:Initializing 'ip4' method cache (platform: 'darwin') DEBUG:getmac:Finished initializing 'ip4' method cache DEBUG:getmac:Raw MAC found: XXXXXXXXXX Exception in thread WebSocketClient: Traceback (most recent call last): File "/Users/dev/opt/lgtv/lib/python3.11/site-packages/ws4py/websocket.py", line 528, in run if not self.once(): ^^^^^^^^^^^ File "/Users/dev/opt/lgtv/lib/python3.11/site-packages/ws4py/websocket.py", line 410, in once if not self.process(self.buf[:requested]): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/dev/opt/lgtv/lib/python3.11/site-packages/ws4py/websocket.py", line 480, in process self.received_message(s.message) File "/Users/dev/opt/lgtv/lib/python3.11/site-packages/LGTV/auth.py", line 58, in received_message self.__waiting_callback(json.loads(str(response))) File "/Users/dev/opt/lgtv/lib/python3.11/site-packages/LGTV/auth.py", line 41, in __prompt if response['payload']['pairingType'] == "PROMPT":


KeyError: 'pairingType'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/dev/anaconda3/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/Users/dev/anaconda3/lib/python3.11/threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/dev/opt/lgtv/lib/python3.11/site-packages/ws4py/websocket.py", line 531, in run
    self.terminate()
  File "/Users/dev/opt/lgtv/lib/python3.11/site-packages/ws4py/websocket.py", line 431, in terminate
    self.closed(1006, "Going away")
  File "/Users/dev/opt/lgtv/lib/python3.11/site-packages/LGTV/auth.py", line 64, in closed
    "reason": reason.decode('utf-8')
              ^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
Wrote config file: /Users/dev/.lgtv/config.json