mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
Remove Spotify scope check (#123545)
This commit is contained in:
parent
e1336a1975
commit
5b6bfa9ac8
@ -31,7 +31,7 @@ from homeassistant.util.dt import utcnow
|
|||||||
|
|
||||||
from . import SpotifyConfigEntry
|
from . import SpotifyConfigEntry
|
||||||
from .browse_media import async_browse_media_internal
|
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 .models import HomeAssistantSpotifyData
|
||||||
from .util import fetch_image_url
|
from .util import fetch_image_url
|
||||||
|
|
||||||
@ -138,10 +138,6 @@ class SpotifyMediaPlayer(MediaPlayerEntity):
|
|||||||
entry_type=DeviceEntryType.SERVICE,
|
entry_type=DeviceEntryType.SERVICE,
|
||||||
configuration_url="https://open.spotify.com",
|
configuration_url="https://open.spotify.com",
|
||||||
)
|
)
|
||||||
|
|
||||||
self._scope_ok = set(data.session.token["scope"].split(" ")).issuperset(
|
|
||||||
SPOTIFY_SCOPES
|
|
||||||
)
|
|
||||||
self._currently_playing: dict | None = {}
|
self._currently_playing: dict | None = {}
|
||||||
self._playlist: dict | None = None
|
self._playlist: dict | None = None
|
||||||
self._restricted_device: bool = False
|
self._restricted_device: bool = False
|
||||||
@ -459,13 +455,6 @@ class SpotifyMediaPlayer(MediaPlayerEntity):
|
|||||||
) -> BrowseMedia:
|
) -> BrowseMedia:
|
||||||
"""Implement the websocket media browsing helper."""
|
"""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(
|
return await async_browse_media_internal(
|
||||||
self.hass,
|
self.hass,
|
||||||
self.data.client,
|
self.data.client,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user