Fix device sync to Google Assistant if Matter integration is active (#104796)
* Only get Matter device info if device is an actual Matter device * Return None if matter device does not exist * lint * fix test * adjust google assistant test
This commit is contained in:
parent
cc2c7c7be1
commit
52450291cb
4 changed files with 12 additions and 10 deletions
|
@ -686,8 +686,12 @@ class GoogleEntity:
|
|||
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"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue