mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
Fix Spotify scopes evaluation (#42819)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
parent
8b998365a4
commit
e929ae10cd
@ -218,7 +218,9 @@ class SpotifyMediaPlayer(MediaPlayerEntity):
|
||||
self._name = f"Spotify {name}"
|
||||
self._session = session
|
||||
self._spotify = spotify
|
||||
self._scope_ok = set(session.token["scope"].split(" ")) == set(SPOTIFY_SCOPES)
|
||||
self._scope_ok = set(session.token["scope"].split(" ")).issuperset(
|
||||
SPOTIFY_SCOPES
|
||||
)
|
||||
|
||||
self._currently_playing: Optional[dict] = {}
|
||||
self._devices: Optional[List[dict]] = []
|
||||
@ -474,6 +476,9 @@ class SpotifyMediaPlayer(MediaPlayerEntity):
|
||||
"""Implement the websocket media browsing helper."""
|
||||
|
||||
if not self._scope_ok:
|
||||
_LOGGER.debug(
|
||||
"Spotify scopes are not set correctly, this can impact features such as media browsing"
|
||||
)
|
||||
raise NotImplementedError
|
||||
|
||||
if media_content_type in [None, "library"]:
|
||||
|
Loading…
x
Reference in New Issue
Block a user