diff --git a/homeassistant/components/cambridge_audio/media_player.py b/homeassistant/components/cambridge_audio/media_player.py index c0287b9f8fa3ce..1c490cd6ac9e06 100644 --- a/homeassistant/components/cambridge_audio/media_player.py +++ b/homeassistant/components/cambridge_audio/media_player.py @@ -45,6 +45,7 @@ TransportControl.TOGGLE_REPEAT: MediaPlayerEntityFeature.REPEAT_SET, TransportControl.TOGGLE_SHUFFLE: MediaPlayerEntityFeature.SHUFFLE_SET, TransportControl.SEEK: MediaPlayerEntityFeature.SEEK, + TransportControl.STOP: MediaPlayerEntityFeature.STOP, } diff --git a/tests/components/cambridge_audio/test_media_player.py b/tests/components/cambridge_audio/test_media_player.py index b344c2faa2b006..391cdd868ec953 100644 --- a/tests/components/cambridge_audio/test_media_player.py +++ b/tests/components/cambridge_audio/test_media_player.py @@ -26,6 +26,7 @@ SERVICE_MEDIA_PLAY, SERVICE_MEDIA_PREVIOUS_TRACK, SERVICE_MEDIA_SEEK, + SERVICE_MEDIA_STOP, SERVICE_REPEAT_SET, SERVICE_SHUFFLE_SET, SERVICE_TURN_OFF, @@ -181,6 +182,7 @@ async def test_media_play_pause_stop( mock_stream_magic_client.now_playing.controls = [ TransportControl.PLAY, TransportControl.PAUSE, + TransportControl.STOP, ] await mock_state_update(mock_stream_magic_client) await hass.async_block_till_done() @@ -191,6 +193,9 @@ async def test_media_play_pause_stop( await hass.services.async_call(MP_DOMAIN, SERVICE_MEDIA_PLAY, data, True) mock_stream_magic_client.play.assert_called_once() + await hass.services.async_call(MP_DOMAIN, SERVICE_MEDIA_STOP, data, True) + mock_stream_magic_client.stop.assert_called_once() + async def test_media_next_previous_track( hass: HomeAssistant,