nagyrobi/home-assistant-custom-components-linkplay

Music Assistant - Linkplay issue

lucasimons opened this issue · 7 comments

i used this integration and it worked with music assistant but currently it doesn't go and give this error, if i try to play from local files it works but i can't use spotify

i have opened a issue with music assistant

2022-08-15 11:14:40.861 ERROR (MainThread) [homeassistant.helpers.entity] Update for media_player.seeme_hifi fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 514, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 709, in async_device_update
    raise exc
  File "/config/custom_components/linkplay/media_player.py", line 543, in async_update
    await self.async_get_status(no_throttle=True)
  File "/config/custom_components/linkplay/media_player.py", line 469, in async_get_status
    resp = await self.call_linkplay_httpapi("getPlayerStatus", True)
  File "/config/custom_components/linkplay/media_player.py", line 419, in call_linkplay_httpapi
    data = await response.json(content_type=None)
  File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 52, in json
    return await super().json(*args, loads=loads, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1119, in json
    return loads(stripped.decode(encoding))
LookupError: unknown encoding: VISCII
2022-08-15 11:14:43.866 ERROR (MainThread) [homeassistant.helpers.entity] Update for media_player.seeme_hifi fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 514, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 709, in async_device_update
    raise exc
  File "/config/custom_components/linkplay/media_player.py", line 543, in async_update
    await self.async_get_status(no_throttle=True)
  File "/config/custom_components/linkplay/media_player.py", line 469, in async_get_status
    resp = await self.call_linkplay_httpapi("getPlayerStatus", True)
  File "/config/custom_components/linkplay/media_player.py", line 419, in call_linkplay_httpapi
    data = await response.json(content_type=None)
  File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 52, in json
    return await super().json(*args, loads=loads, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1119, in json
    return loads(stripped.decode(encoding))
orjson.JSONDecodeError: unexpected control character in string: line 1 column 135 (char 134)

```

What component version do you use?

3.1.5

It's a problem with metadata coming from Spotify, has some strange character encoding in your case...

I used this speaker with music assistant but after the update of HA and MA I can play anything with the player created by MA and the original player can't play Spotify

Now this error persist, but with local music or tts the player works fine

Logger: homeassistant.helpers.entity
Source: helpers/aiohttp_client.py:52
First occurred: 11:11:26 (113 occurrences)
Last logged: 11:11:32

Update for media_player.seeme_hifi fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 514, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 709, in async_device_update
    raise exc
  File "/config/custom_components/linkplay/media_player.py", line 543, in async_update
    await self.async_get_status(no_throttle=True)
  File "/config/custom_components/linkplay/media_player.py", line 469, in async_get_status
    resp = await self.call_linkplay_httpapi("getPlayerStatus", True)
  File "/config/custom_components/linkplay/media_player.py", line 419, in call_linkplay_httpapi
    data = await response.json(content_type=None)
  File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 52, in json
    return await super().json(*args, loads=loads, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1119, in json
    return loads(stripped.decode(encoding))
orjson.JSONDecodeError: unexpected control character in string: line 1 column 135 (char 134)
```

This is my actual configuration

Home Assistant 2022.8.7
Supervisor 2022.08.3
Operating System 8.5
Frontend 20220802.0 - latest

Now the error are this:

Logger: homeassistant.components.media_player
Source: helpers/entity_platform.py:778
Integration: Lettore multimediale ([documentation](https://www.home-assistant.io/integrations/media_player), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+media_player%22))
First occurred: 08:08:29 (45 occurrences)
Last logged: 08:25:27


Updating linkplay media_player took longer than the scheduled update interval 0:00:03

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:514
First occurred: 08:23:27 (1 occurrences)
Last logged: 08:23:27

Update of media_player.seeme_hifi is taking over 10 seconds
Logger: music_assistant.players.stream
Source: runner.py:119
First occurred: 08:23:25 (1 occurrences)
Last logged: 08:23:25

Abort: client(s) did not connect within 10 seconds.
Logger: homeassistant.helpers.entity
Source: helpers/aiohttp_client.py:52
First occurred: 16:31:17 (1 occurrences)
Last logged: 16:31:17

Update for media_player.seeme_hifi fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 514, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 709, in async_device_update
    raise exc
  File "/config/custom_components/linkplay/media_player.py", line 543, in async_update
    await self.async_get_status(no_throttle=True)
  File "/config/custom_components/linkplay/media_player.py", line 469, in async_get_status
    resp = await self.call_linkplay_httpapi("getPlayerStatus", True)
  File "/config/custom_components/linkplay/media_player.py", line 419, in call_linkplay_httpapi
    data = await response.json(content_type=None)
  File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 52, in json
    return await super().json(*args, loads=loads, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1119, in json
    return loads(stripped.decode(encoding))
orjson.JSONDecodeError: unexpected control character in string: line 1 column 150 (char 149)


Issue is caused by invalid characters in metadata music-assistant/hass-music-assistant#835 (comment).