From da7e26c287ecd0658e5b44ac83bfac4a511461b2 Mon Sep 17 00:00:00 2001 From: Simone Chemelli Date: Sun, 24 Oct 2021 09:51:02 +0200 Subject: [PATCH] Filter by connections instead of identifiers for Shelly (#58305) * Fix connections * Switch to helper --- homeassistant/components/shelly/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/shelly/__init__.py b/homeassistant/components/shelly/__init__.py index f181817e6f1..6b15e4e730d 100644 --- a/homeassistant/components/shelly/__init__.py +++ b/homeassistant/components/shelly/__init__.py @@ -132,7 +132,13 @@ async def async_setup_block_entry(hass: HomeAssistant, entry: ConfigEntry) -> bo device_entry = None if entry.unique_id is not None: device_entry = dev_reg.async_get_device( - identifiers={(DOMAIN, entry.unique_id)}, connections=set() + identifiers=set(), + connections={ + ( + device_registry.CONNECTION_NETWORK_MAC, + device_registry.format_mac(entry.unique_id), + ) + }, ) if device_entry and entry.entry_id not in device_entry.config_entries: device_entry = None