Skip to content

Commit

Permalink
Fritz: fix unbound topology (home-assistant#66877)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael <[email protected]>
Co-authored-by: Paulus Schoutsen <[email protected]>
  • Loading branch information
3 people authored Feb 20, 2022
1 parent 3c15fe8 commit f0fbc7b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions homeassistant/components/fritz/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ def scan_devices(self, now: datetime | None = None) -> None:
_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"
Expand Down Expand Up @@ -372,7 +373,7 @@ def scan_devices(self, now: datetime | None = None) -> None:

mesh_intf = {}
# first get all meshed devices
for node in topology["nodes"]:
for node in topology.get("nodes", []):
if not node["is_meshed"]:
continue

Expand All @@ -389,7 +390,7 @@ def scan_devices(self, now: datetime | None = None) -> None:
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

Expand Down

0 comments on commit f0fbc7b

Please sign in to comment.