fondberg / spotcast

Home assistant custom component to start Spotify playback on an idle chromecast device as well as control spotify connect devices
Apache License 2.0
702 stars 100 forks source link

Spotcast don't work, Python errors #493

Closed PrzemekSkw closed 1 day ago

PrzemekSkw commented 1 day ago

The problem

Cannot read Spotify Playlists (Unknown Error), see other favourite Albums, Artists, Songs but cannot play.

System Health details

Wersja  core-2024.11.3
Installation type   Unsupported Third Party Container
Development false
Supervisor  false
Docker  true
Użytkownik  abc
Virtual environment false
Python version  3.12.4
Operating system family Linux
Operating system version    6.1.118-Unraid
CPU architecture    x86_64
Strefa czasowa  Europe/Warsaw
Configuration directory /config
Home Assistant Community Store
error   unknown
Home Assistant Cloud
Zalogowany  false
Reach certificate server    ok
Reach authentication server ok
Dostęp do chmury Home Assistant ok
Dashboards
Dashboardy  5
Zasoby  66
Widoki  10
Tryb    storage
Recorder
Oldest run start time   24 listopada 2024 16:21
Current run start time  3 grudnia 2024 15:16
Estimated database size (MiB)   285.65 MiB
Database engine sqlite
Database version    3.45.3
Spotify
Punkt końcowy Spotify API osiągalny timeout

Spotcast Version

v4.0.0

What type of installation are you running?

Home Assistant Core

Diagnostics information

home-assistant_spotcast_2024-12-03T14-34-08.248Z.log

Example YAML snippet

configuration.yaml:

spotcast:
  sp_dc: !secret sp_dc
  sp_key: !secret sp_key

secrets.yaml:

sp_dc: AQA.....
sp_key: 88552......

### Anything in the logs that might be useful for us?

```txt
Logs from unraid HA container:

2024-12-03 15:35:21.705 ERROR (MainThread) [homeassistant.components.spotify.coordinator] Unexpected error fetching spotify data
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/update_coordinator.py", line 382, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/homeassistant/components/spotify/coordinator.py", line 97, in _async_update_data
    audio_features = await self.client.get_audio_features(item.uri)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/spotifyaio/spotify.py", line 518, in get_audio_features
    return AudioFeatures.from_json(response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<string>", line 7, in __mashumaro_from_json__
mashumaro.exceptions.MissingField: Field "danceability" of type float is missing in AudioFeatures instance
2024-12-03 15:35:56.739 ERROR (MainThread) [homeassistant.components.spotify.coordinator] Unexpected error fetching spotify data
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/update_coordinator.py", line 382, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/homeassistant/components/spotify/coordinator.py", line 97, in _async_update_data
    audio_features = await self.client.get_audio_features(item.uri)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/spotifyaio/spotify.py", line 518, in get_audio_features
    return AudioFeatures.from_json(response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<string>", line 7, in __mashumaro_from_json__
mashumaro.exceptions.MissingField: Field "danceability" of type float is missing in AudioFeatures instance
2024-12-03 15:36:28.682 WARNING (MainThread) [androidtv.adb_manager.adb_manager_async] Couldn't connect to 192.168.0.105:5555.  TcpTimeoutException: Connecting to 192.168.0.105:5555 timed out (1.0 seconds)
2024-12-03 15:36:31.742 ERROR (MainThread) [homeassistant.components.spotify.coordinator] Unexpected error fetching spotify data
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/update_coordinator.py", line 382, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/homeassistant/components/spotify/coordinator.py", line 97, in _async_update_data
    audio_features = await self.client.get_audio_features(item.uri)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/spotifyaio/spotify.py", line 518, in get_audio_features
    return AudioFeatures.from_json(response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<string>", line 7, in __mashumaro_from_json__
mashumaro.exceptions.MissingField: Field "danceability" of type float is missing in AudioFeatures instance


### Additional information

_No response_
fcusson commented 1 day ago

@PrzemekSkw the issue is with the main Spotify Integration you can follow #131737 for the resolution. Should be fixed with the release of 2024.12.

Spotcast doesn't manage the media browsing, we just enable the Spotify Integration on Chromecast by providing a way to start playback.