From 3ec9312f0e42079786fc352606c51d371d93cc8e Mon Sep 17 00:00:00 2001 From: Greg Dowling Date: Sat, 23 Mar 2024 13:53:40 +0000 Subject: [PATCH] Fix bug in roon media player to use correct 'seek position' while playing a track. (#113999) Chance source of 'seek position' to be the one that roon updates while playing! --- homeassistant/components/roon/media_player.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/roon/media_player.py b/homeassistant/components/roon/media_player.py index c88b887c10e..3b1735cd2fc 100644 --- a/homeassistant/components/roon/media_player.py +++ b/homeassistant/components/roon/media_player.py @@ -233,12 +233,13 @@ class RoonDevice(MediaPlayerEntity): } now_playing_data = None + media_position = convert(player_data.get("seek_position"), int, 0) + try: now_playing_data = player_data["now_playing"] media_title = now_playing_data["three_line"]["line1"] media_artist = now_playing_data["three_line"]["line2"] media_album_name = now_playing_data["three_line"]["line3"] - media_position = convert(now_playing_data["seek_position"], int, 0) media_duration = convert(now_playing_data.get("length"), int, 0) image_id = now_playing_data.get("image_key") except KeyError: