From b94879ea51212688718ae06538c78c43fe3bf80a Mon Sep 17 00:00:00 2001 From: Alex Fishlock Date: Sat, 29 Aug 2026 07:29:01 +0200 Subject: [PATCH] Add a regression test for the Lyngdorf media player position (#180530) --- tests/components/lyngdorf/test_media_player.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/components/lyngdorf/test_media_player.py b/tests/components/lyngdorf/test_media_player.py index db6f39e8cf0a..f1d4811eb028 100644 --- a/tests/components/lyngdorf/test_media_player.py +++ b/tests/components/lyngdorf/test_media_player.py @@ -485,6 +485,20 @@ async def test_no_streaming_features_on_model_without_streamer( assert state.attributes.get(ATTR_MEDIA_TITLE) is None +@pytest.mark.usefixtures("init_integration") +async def test_no_position_before_the_streamer_reports_one( + hass: HomeAssistant, + playing_receiver: MagicMock, +) -> None: + """Test an attached player that has not yet reported a position.""" + playing_receiver.position_ms = None + notify_receiver_update(playing_receiver) + await hass.async_block_till_done() + + state = hass.states.get(MAIN_ZONE) + assert state.attributes.get(ATTR_MEDIA_POSITION) is None + + @pytest.mark.usefixtures("init_integration") async def test_position_jump_updates_state( hass: HomeAssistant,