Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Google Cast groups to device registry #66805

Merged
merged 3 commits into from Feb 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 6 additions & 7 deletions homeassistant/components/cast/media_player.py
Expand Up @@ -292,13 +292,12 @@ def __init__(self, hass: HomeAssistant, cast_info: ChromecastInfo) -> None:
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."""
Expand Down
2 changes: 1 addition & 1 deletion tests/components/cast/test_media_player.py
Expand Up @@ -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"
Expand Down