Fix freebox enumerate raid disks (#97696)

pull/97766/head
Cyr-ius 2023-08-04 09:25:51 +02:00 committed by GitHub
parent 37885400c9
commit 3ac2106eb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -161,10 +161,13 @@ class FreeboxRouter:
async def _update_raids_sensors(self) -> None:
"""Update Freebox raids."""
# None at first request
fbx_raids: list[dict[str, Any]] = await self._api.storage.get_raids() or []
for fbx_raid in fbx_raids:
self.raids[fbx_raid["id"]] = fbx_raid
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
async def update_home_devices(self) -> None:
"""Update Home devices (alarm, light, sensor, switch, remote ...)."""