From 31867d54b6fb5b05eb292b460a6948f91d44c301 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Tue, 22 Feb 2022 09:26:41 +0000 Subject: [PATCH] Add Google Cast groups to device registry (#66805) --- homeassistant/components/cast/media_player.py | 13 ++++++------- tests/components/cast/test_media_player.py | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/cast/media_player.py b/homeassistant/components/cast/media_player.py index bfbe4f84d60..091bde53ae0 100644 --- a/homeassistant/components/cast/media_player.py +++ b/homeassistant/components/cast/media_player.py @@ -292,13 +292,12 @@ class CastMediaPlayerEntity(CastDevice, MediaPlayerEntity): self._cast_view_remove_handler = None self._attr_unique_id = str(cast_info.uuid) self._attr_name = cast_info.friendly_name - if cast_info.cast_info.model_name != "Google Cast Group": - self._attr_device_info = DeviceInfo( - identifiers={(CAST_DOMAIN, str(cast_info.uuid).replace("-", ""))}, - manufacturer=str(cast_info.cast_info.manufacturer), - model=cast_info.cast_info.model_name, - name=str(cast_info.friendly_name), - ) + self._attr_device_info = DeviceInfo( + identifiers={(CAST_DOMAIN, str(cast_info.uuid).replace("-", ""))}, + manufacturer=str(cast_info.cast_info.manufacturer), + model=cast_info.cast_info.model_name, + name=str(cast_info.friendly_name), + ) async def async_added_to_hass(self): """Create chromecast object when added to hass.""" diff --git a/tests/components/cast/test_media_player.py b/tests/components/cast/test_media_player.py index 2299389f12b..4f12a2b02bb 100644 --- a/tests/components/cast/test_media_player.py +++ b/tests/components/cast/test_media_player.py @@ -632,7 +632,7 @@ async def test_entity_availability(hass: HomeAssistant): assert state.state == "unavailable" -@pytest.mark.parametrize("port,entry_type", ((8009, None),)) +@pytest.mark.parametrize("port,entry_type", ((8009, None), (12345, None))) async def test_device_registry(hass: HomeAssistant, port, entry_type): """Test device registry integration.""" entity_id = "media_player.speaker"