diff --git a/homeassistant/components/fritz/common.py b/homeassistant/components/fritz/common.py index d5410bf232c..5706ca19486 100644 --- a/homeassistant/components/fritz/common.py +++ b/homeassistant/components/fritz/common.py @@ -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