mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +00:00
Disable Spotify controls when no active session (#96914)
This commit is contained in:
parent
d4cdb0453f
commit
2365e4c159
@ -139,11 +139,11 @@ class SpotifyMediaPlayer(MediaPlayerEntity):
|
|||||||
@property
|
@property
|
||||||
def supported_features(self) -> MediaPlayerEntityFeature:
|
def supported_features(self) -> MediaPlayerEntityFeature:
|
||||||
"""Return the supported features."""
|
"""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
|
return MediaPlayerEntityFeature.SELECT_SOURCE
|
||||||
if self.data.current_user["product"] == "premium":
|
return SUPPORT_SPOTIFY
|
||||||
return SUPPORT_SPOTIFY
|
|
||||||
return MediaPlayerEntityFeature(0)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self) -> MediaPlayerState:
|
def state(self) -> MediaPlayerState:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user