mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 05:05:09 +02:00
Disable Spotify controls when no active session (#96914)
This commit is contained in:
committed by
GitHub
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.SELECT_SOURCE
|
|
||||||
if self.data.current_user["product"] == "premium":
|
|
||||||
return SUPPORT_SPOTIFY
|
|
||||||
return MediaPlayerEntityFeature(0)
|
return MediaPlayerEntityFeature(0)
|
||||||
|
if self._restricted_device or not self._currently_playing:
|
||||||
|
return MediaPlayerEntityFeature.SELECT_SOURCE
|
||||||
|
return SUPPORT_SPOTIFY
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self) -> MediaPlayerState:
|
def state(self) -> MediaPlayerState:
|
||||||
|
Reference in New Issue
Block a user