martonborzak / beoplay-custom-component

Custom component for Beoplay speakers in Home Assistant
MIT License
9 stars 6 forks source link

Changing tunein radio station triggers an error #3

Open tlk opened 5 years ago

tlk commented 5 years ago

How to reproduce:

  1. Use the "Bang&Olufsen" mobile app to make the device play music from a radio station via tunein
  2. Confirm that the radio station logo is displayed as expected in Home Assistant
  3. Use the "Bang&Olufsen" mobile app to change the radio station

Expected result: Station logo and name updated in the Home Assistant UI.

Actual result: Station logo and name is not updated and the Home Assistant log shows the following:

2019-05-17 15:37:58 ERROR (MainThread) [custom_components.beoplay.media_player] Unexpected error in Beoplay M5
Traceback (most recent call last):
  File "/Users/tlk/.homeassistant/custom_components/beoplay/media_player.py", line 171, in _start_poll_command
    await self.async_update_status()
  File "/Users/tlk/.homeassistant/custom_components/beoplay/media_player.py", line 219, in async_update_status
    self._speaker.getMusicInfo(data_json)
  File "/Users/tlk/projects/home-assistant/venv/lib/python3.7/site-packages/beoplay/__init__.py", line 125, in getMusicInfo
    if data["notification"]["data"]["liveDescription"]:
KeyError: 'liveDescription'
martonborzak commented 5 years ago

I'll look at it. I think it has to be done in the wrapper.