Disable Spotify controls when no active session (#96914)

This commit is contained in:
Joost Lekkerkerker 2023-07-23 10:59:29 +02:00 committed by GitHub
parent d4cdb0453f
commit 2365e4c159
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -139,11 +139,11 @@ class SpotifyMediaPlayer(MediaPlayerEntity):
@property
def supported_features(self) -> MediaPlayerEntityFeature:
"""Return the supported features."""
if self._restricted_device:
if self.data.current_user["product"] != "premium":
return MediaPlayerEntityFeature(0)
if self._restricted_device or not self._currently_playing:
return MediaPlayerEntityFeature.SELECT_SOURCE
if self.data.current_user["product"] == "premium":
return SUPPORT_SPOTIFY
return MediaPlayerEntityFeature(0)
return SUPPORT_SPOTIFY
@property
def state(self) -> MediaPlayerState: