Remove Spotify scope check (#123545)

This commit is contained in:
Joost Lekkerkerker 2024-08-12 09:04:12 +02:00 committed by GitHub
parent e1336a1975
commit 5b6bfa9ac8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -31,7 +31,7 @@ from homeassistant.util.dt import utcnow
from . import SpotifyConfigEntry
from .browse_media import async_browse_media_internal
from .const import DOMAIN, MEDIA_PLAYER_PREFIX, PLAYABLE_MEDIA_TYPES, SPOTIFY_SCOPES
from .const import DOMAIN, MEDIA_PLAYER_PREFIX, PLAYABLE_MEDIA_TYPES
from .models import HomeAssistantSpotifyData
from .util import fetch_image_url
@ -138,10 +138,6 @@ class SpotifyMediaPlayer(MediaPlayerEntity):
entry_type=DeviceEntryType.SERVICE,
configuration_url="https://open.spotify.com",
)
self._scope_ok = set(data.session.token["scope"].split(" ")).issuperset(
SPOTIFY_SCOPES
)
self._currently_playing: dict | None = {}
self._playlist: dict | None = None
self._restricted_device: bool = False
@ -459,13 +455,6 @@ class SpotifyMediaPlayer(MediaPlayerEntity):
) -> BrowseMedia:
"""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
return await async_browse_media_internal(
self.hass,
self.data.client,