Sholofly / lghorizon

Custom integration to control LG Horizon settop boxes for Ziggo(NL), Magenta(AT), UPC(CH), Virgin(GB, IE), Telenet(BE)
GNU General Public License v3.0
63 stars 15 forks source link

TypeError: 'NoneType' object is not subscriptable #127

Closed golles closed 1 month ago

golles commented 1 month ago

Describe the bug Had just turned off the media box and noticed my dashboard was still showing it as on, also kept on updating the image.

To Reproduce I sadly have no more info here. I haven't seen issues recently, what I did today that I not very often do is put the media box to the radio (qmusic), but that was early in the afternoon.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots

Scherm­afbeelding 2024-10-01 om 23 18 09

Version of the component 0.5.11 lghorizon>=0.6.13

❯ git status
On branch dev
Your branch is up to date with 'origin/dev'.

nothing to commit, working tree clean

Logging The only log I could find was from earlier today, it looks like from when I turned off the device, see image above.

2024-10-01 18:39:21.401 ERROR (Thread-3 (_thread_main)) [lghorizon.lghorizon_api] Could not handle status message
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/lghorizon/lghorizon_api.py", line 336, in _on_mqtt_message
    self._handle_box_update(deviceId, message)
  File "/usr/local/lib/python3.12/site-packages/lghorizon/lghorizon_api.py", line 370, in _handle_box_update
    eventId = state_source["eventId"]
              ~~~~~~~~~~~~^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
2024-10-01 18:39:21.403 WARNING (Thread-3 (_thread_main)) [lghorizon.lghorizon_api] Full message: {'version': '1.3.18', 'type': 'CPE.uiStatus', 'source': '3C36E4-EOSSTB-003926772108', 'messageTimeStamp': 1727800761353, 'status': {'uiStatus': 'mainUI', 'playerState': {'sourceType': 'replay', 'speed': 0, 'lastSpeedChangeTime': 1727721567756, 'source': None, 'relativePosition': 0}, 'uiState': {}}}

Additional context I think this issue lacks useful information, but I hope the trace can help prevent it, thanks!

Sholofly commented 1 month ago

Does the box recover from this issue over time?

golles commented 1 month ago

I haven't tried that, I rebooted HA as it was getting late

Sholofly commented 1 month ago

It's not really fixing it but 0.6.1 should avoid the error