Skip to content

Commit

Permalink
fix IEEE lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
dmulcahey committed Oct 3, 2024
1 parent e2d4bfa commit 448c5f3
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions homeassistant/components/zha/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,11 +553,19 @@ async def _handle_entity_registry_updated(
device_entry: dr.DeviceEntry | None = dr.async_get(self.hass).async_get(
entity_entry.device_id
)
if device_entry is None:
return
ieee = EUI64.convert(list(list(device_entry.identifiers)[0])[1])
if ieee not in self.device_proxies:
return
assert device_entry

ieee_address = next(
identifier
for domain, identifier in device_entry.identifiers
if domain == DOMAIN
)
assert ieee_address

ieee = EUI64.convert(ieee_address)

assert ieee in self.device_proxies

zha_device_proxy = self.device_proxies[ieee]
if entity_entry.unique_id not in zha_device_proxy.device.platform_entities:
return
Expand Down

0 comments on commit 448c5f3

Please sign in to comment.