Fritz: fix unbound topology (#66877)

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
pull/66919/head
Simone Chemelli 2022-02-20 06:07:40 +01:00 committed by GitHub
parent 3c15fe8587
commit f0fbc7bb2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -331,6 +331,7 @@ class FritzBoxTools(update_coordinator.DataUpdateCoordinator):
_LOGGER.debug("Checking host info for FRITZ!Box device %s", self.host)
self._update_available, self._latest_firmware = self._update_device_info()
topology: dict = {}
if (
"Hosts1" not in self.connection.services
or "X_AVM-DE_GetMeshListPath"
@ -372,7 +373,7 @@ class FritzBoxTools(update_coordinator.DataUpdateCoordinator):
mesh_intf = {}
# first get all meshed devices
for node in topology["nodes"]:
for node in topology.get("nodes", []):
if not node["is_meshed"]:
continue
@ -389,7 +390,7 @@ class FritzBoxTools(update_coordinator.DataUpdateCoordinator):
self.mesh_role = MeshRoles(node["mesh_role"])
# second get all client devices
for node in topology["nodes"]:
for node in topology.get("nodes", []):
if node["is_meshed"]:
continue