Fix freebox enumerate raid disks (#97696)

This commit is contained in:
Cyr-ius 2023-08-04 09:25:51 +02:00 committed by Franck Nijhof
parent 7a244e30a4
commit 0617363f53
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3

View File

@ -161,8 +161,11 @@ class FreeboxRouter:
async def _update_raids_sensors(self) -> None:
"""Update Freebox raids."""
# None at first request
try:
fbx_raids: list[dict[str, Any]] = await self._api.storage.get_raids() or []
except HttpRequestError:
_LOGGER.warning("Unable to enumerate raid disks")
else:
for fbx_raid in fbx_raids:
self.raids[fbx_raid["id"]] = fbx_raid