Fix conntected_to attribute of device tracker entities in a AVM Fritz mesh setup (#129259)

ignore orphan node links
This commit is contained in:
Michael 2024-10-27 14:42:43 +01:00 committed by GitHub
parent 3bd0fca633
commit 3165f92b6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 20 additions and 1 deletions

View File

@ -606,6 +606,9 @@ class FritzBoxTools(DataUpdateCoordinator[UpdateCoordinatorDataType]):
dev_info: Device = hosts[dev_mac]
for link in interf["node_links"]:
if link.get("state") != "CONNECTED":
continue # ignore orphan node links
intf = mesh_intf.get(link["node_interface_1_uid"])
if intf is not None:
if intf["op_mode"] == "AP_GUEST":

View File

@ -655,7 +655,23 @@ MOCK_MESH_DATA = {
"cur_data_rate_tx": 0,
"cur_availability_rx": 99,
"cur_availability_tx": 99,
}
},
{
"uid": "nl-79",
"type": "LAN",
"state": "DISCONNECTED",
"last_connected": 1642872667,
"node_1_uid": "n-167",
"node_2_uid": "n-76",
"node_interface_1_uid": "ni-140",
"node_interface_2_uid": "ni-77",
"max_data_rate_rx": 1000000,
"max_data_rate_tx": 1000000,
"cur_data_rate_rx": 0,
"cur_data_rate_tx": 0,
"cur_availability_rx": 99,
"cur_availability_tx": 99,
},
],
}
],