mirror of
https://github.com/home-assistant/core.git
synced 2025-08-17 19:41:45 +02:00
Fix Spotify deviding None value in current progress (#76581)
This commit is contained in:
committed by
Paulus Schoutsen
parent
a3ea881a01
commit
738423056e
@@ -180,7 +180,10 @@ class SpotifyMediaPlayer(MediaPlayerEntity):
|
||||
@property
|
||||
def media_position(self) -> int | None:
|
||||
"""Position of current playing media in seconds."""
|
||||
if not self._currently_playing:
|
||||
if (
|
||||
not self._currently_playing
|
||||
or self._currently_playing.get("progress_ms") is None
|
||||
):
|
||||
return None
|
||||
return self._currently_playing["progress_ms"] / 1000
|
||||
|
||||
|
Reference in New Issue
Block a user