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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix device sync to Google Assistant if Matter integration is active #104796

Merged
merged 5 commits into from Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
14 changes: 7 additions & 7 deletions homeassistant/components/google_assistant/helpers.py
Expand Up @@ -59,11 +59,7 @@
@callback
def _get_registry_entries(
hass: HomeAssistant, entity_id: str
) -> tuple[
er.RegistryEntry | None,
dr.DeviceEntry | None,
ar.AreaEntry | None,
]:
) -> tuple[er.RegistryEntry | None, dr.DeviceEntry | None, ar.AreaEntry | None,]:
"""Get registry entries."""
ent_reg = er.async_get(hass)
dev_reg = dr.async_get(hass)
Expand Down Expand Up @@ -686,8 +682,12 @@ def sync_serialize(self, agent_user_id, instance_uuid):
return device

# Add Matter info
if "matter" in self.hass.config.components and (
matter_info := matter.get_matter_device_info(self.hass, device_entry.id)
if (
"matter" in self.hass.config.components
and any(x for x in device_entry.identifiers if x[0] == "matter")
and (
matter_info := matter.get_matter_device_info(self.hass, device_entry.id)
)
):
device["matterUniqueId"] = matter_info["unique_id"]
device["matterOriginalVendorId"] = matter_info["vendor_id"]
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/matter/helpers.py
Expand Up @@ -94,7 +94,7 @@ def get_node_from_device_entry(
)

if device_id_full is None:
raise ValueError(f"Device {device.id} is not a Matter device")
return None

device_id = device_id_full.lstrip(device_id_type_prefix)
matter_client = matter.matter_client
Expand Down