diff --git a/homeassistant/components/cast/media_player.py b/homeassistant/components/cast/media_player.py index 02d62ca489b..3f3fec4dc9a 100644 --- a/homeassistant/components/cast/media_player.py +++ b/homeassistant/components/cast/media_player.py @@ -456,7 +456,8 @@ class CastMediaPlayerEntity(CastDevice, MediaPlayerEntity): # The only way we can turn the Chromecast is on is by launching an app if self._chromecast.cast_type == pychromecast.const.CAST_TYPE_CHROMECAST: - self._chromecast.play_media(CAST_SPLASH, "image/png") + app_data = {"media_id": CAST_SPLASH, "media_type": "image/png"} + quick_play(self._chromecast, "default_media_receiver", app_data) else: self._chromecast.start_app(pychromecast.config.APP_MEDIA_RECEIVER) diff --git a/tests/components/cast/test_media_player.py b/tests/components/cast/test_media_player.py index 2e6fafb0287..277acf849cf 100644 --- a/tests/components/cast/test_media_player.py +++ b/tests/components/cast/test_media_player.py @@ -1157,7 +1157,7 @@ async def test_entity_media_content_type(hass: HomeAssistant): assert state.attributes.get("media_content_type") == "movie" -async def test_entity_control(hass: HomeAssistant): +async def test_entity_control(hass: HomeAssistant, quick_play_mock): """Test various device and media controls.""" entity_id = "media_player.speaker" reg = er.async_get(hass) @@ -1200,8 +1200,13 @@ async def test_entity_control(hass: HomeAssistant): # Turn on await common.async_turn_on(hass, entity_id) - chromecast.play_media.assert_called_once_with( - "https://www.home-assistant.io/images/cast/splash.png", "image/png" + quick_play_mock.assert_called_once_with( + chromecast, + "default_media_receiver", + { + "media_id": "https://www.home-assistant.io/images/cast/splash.png", + "media_type": "image/png", + }, ) chromecast.quit_app.reset_mock()