Collect both gateway macs for Plugwise (#183030)

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Bouwe Westerdijk
2026-09-24 20:29:40 +02:00
committed by GitHub
co-authored by Copilot Autofix powered by AI
parent ec54df4459
commit c600261063
2 changed files with 12 additions and 3 deletions
+8 -3
View File
@@ -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))
+4
View File
@@ -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"