1
0
mirror of https://github.com/home-assistant/core.git synced 2026-08-06 13:26:29 +01:00

Migrate home_connect dhcp flow to call async_get_devices (#177972)

This commit is contained in:
Erik Montnemery
2026-08-03 18:10:58 +02:00
committed by GitHub
parent 16b81bfd57
commit c5ce6efa45
@@ -68,14 +68,14 @@ class OAuth2FlowHandler(
) -> ConfigFlowResult:
"""Handle a DHCP discovery."""
device_registry = dr.async_get(self.hass)
if device_entry := device_registry.async_get_device(
for device in device_registry.async_get_devices(
identifiers={
(DOMAIN, discovery_info.hostname),
(DOMAIN, discovery_info.hostname.split("-")[-1]),
}
):
device_registry.async_update_device(
device_entry.id,
device.id,
new_connections={
(dr.CONNECTION_NETWORK_MAC, discovery_info.macaddress)
},