From 6e65cb4928301a8cf5ccc4e49d7ccdcd392f5f9f Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Thu, 11 Aug 2022 03:27:52 +0200 Subject: [PATCH] Fix Spotify deviding None value in current progress (#76581) --- homeassistant/components/spotify/media_player.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/spotify/media_player.py b/homeassistant/components/spotify/media_player.py index ea41067e7e9..3db8ae7de08 100644 --- a/homeassistant/components/spotify/media_player.py +++ b/homeassistant/components/spotify/media_player.py @@ -179,7 +179,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