From c6002610630443aadb4087771806e20e2671b453 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk <11290930+bouwew@users.noreply.github.com> Date: Thu, 24 Sep 2026 20:29:40 +0200 Subject: [PATCH] Collect both gateway macs for Plugwise (#183030) Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- homeassistant/components/plugwise/entity.py | 11 ++++++++--- tests/components/plugwise/test_init.py | 4 ++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/plugwise/entity.py b/homeassistant/components/plugwise/entity.py index 7355177cb264..55315b787822 100644 --- a/homeassistant/components/plugwise/entity.py +++ b/homeassistant/components/plugwise/entity.py @@ -43,9 +43,14 @@ class PlugwiseEntity(CoordinatorEntity[PlugwiseDataUpdateCoordinator]): ) # Build connections set - connections = set() - if mac := self.device.get("mac_address"): - connections.add((CONNECTION_NETWORK_MAC, mac)) + connections = { + (CONNECTION_NETWORK_MAC, mac_address) + for mac_address in ( + self.device.get("mac_address"), + self.device.get("wifi_mac_address"), + ) + if mac_address is not None + } if zigbee_mac := self.device.get("zigbee_mac_address"): connections.add((CONNECTION_ZIGBEE, zigbee_mac)) diff --git a/tests/components/plugwise/test_init.py b/tests/components/plugwise/test_init.py index 0f68e8b2dc3c..7b0f59e8a447 100644 --- a/tests/components/plugwise/test_init.py +++ b/tests/components/plugwise/test_init.py @@ -137,6 +137,10 @@ async def test_device_in_dr( device_entry = device_registry.async_get_device_by_identifier( (DOMAIN, "a455b61e52394b2db5081ce025a430f3"), mock_config_entry.entry_id ) + assert device_entry.connections == { + (dr.CONNECTION_NETWORK_MAC, "01:23:45:67:00:01"), + (dr.CONNECTION_NETWORK_MAC, "01:23:45:67:00:02"), + } assert device_entry.hw_version == "AME Smile 2.0 board" assert device_entry.manufacturer == "Plugwise" assert device_entry.model == "Gateway"