mirror of
https://github.com/home-assistant/core.git
synced 2025-06-09 23:57:08 +00:00
Reduce Freebox router Raid warning to one occurence (#98740)
* consider Freebox router does not support Raid if the first enumeration raised an http error, fixes #98274 * add router name to warning message * reduce log level to info, remove details
This commit is contained in:
parent
af0e48081f
commit
c86565b9bc
@ -71,6 +71,7 @@ class FreeboxRouter:
|
|||||||
|
|
||||||
self.devices: dict[str, dict[str, Any]] = {}
|
self.devices: dict[str, dict[str, Any]] = {}
|
||||||
self.disks: dict[int, dict[str, Any]] = {}
|
self.disks: dict[int, dict[str, Any]] = {}
|
||||||
|
self.supports_raid = True
|
||||||
self.raids: dict[int, dict[str, Any]] = {}
|
self.raids: dict[int, dict[str, Any]] = {}
|
||||||
self.sensors_temperature: dict[str, int] = {}
|
self.sensors_temperature: dict[str, int] = {}
|
||||||
self.sensors_connection: dict[str, float] = {}
|
self.sensors_connection: dict[str, float] = {}
|
||||||
@ -159,14 +160,21 @@ class FreeboxRouter:
|
|||||||
|
|
||||||
async def _update_raids_sensors(self) -> None:
|
async def _update_raids_sensors(self) -> None:
|
||||||
"""Update Freebox raids."""
|
"""Update Freebox raids."""
|
||||||
# None at first request
|
if not self.supports_raid:
|
||||||
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
fbx_raids: list[dict[str, Any]] = await self._api.storage.get_raids() or []
|
fbx_raids: list[dict[str, Any]] = await self._api.storage.get_raids() or []
|
||||||
except HttpRequestError:
|
except HttpRequestError:
|
||||||
_LOGGER.warning("Unable to enumerate raid disks")
|
self.supports_raid = False
|
||||||
else:
|
_LOGGER.info(
|
||||||
for fbx_raid in fbx_raids:
|
"Router %s API does not support RAID",
|
||||||
self.raids[fbx_raid["id"]] = fbx_raid
|
self.name,
|
||||||
|
)
|
||||||
|
return
|
||||||
|
|
||||||
|
for fbx_raid in fbx_raids:
|
||||||
|
self.raids[fbx_raid["id"]] = fbx_raid
|
||||||
|
|
||||||
async def update_home_devices(self) -> None:
|
async def update_home_devices(self) -> None:
|
||||||
"""Update Home devices (alarm, light, sensor, switch, remote ...)."""
|
"""Update Home devices (alarm, light, sensor, switch, remote ...)."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user