Skip to content

Commit 474a096

Browse files
authored
Merge pull request #39 from FaserF/fix-mesh-nonetype
fix mesh 'NoneType' if confflow empty
2 parents 0217fea + 8150bef commit 474a096

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

custom_components/openwrt/coordinator.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ def find_mesh_peers(self, mesh_id: str):
7474
result = []
7575
for _, device in self._all_devices.items():
7676
data = device.coordinator.data
77+
if not data or 'mesh' not in data or not data['mesh']:
78+
_LOGGER.warning(f"Missing or invalid 'mesh' data for device: {device}")
79+
continue
7780
for _, mesh in data['mesh'].items():
7881
if mesh['id'] == mesh_id:
7982
result.append(mesh['mac'])

0 commit comments

Comments
 (0)