From bcb31620516c7b8a975b30b9bddd981dce94bba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20S=C3=A1nchez-Gallego?= Date: Wed, 28 Aug 2024 08:21:18 +0000 Subject: [PATCH] Handle calibrations command failure --- src/lvmapi/routers/overwatcher.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lvmapi/routers/overwatcher.py b/src/lvmapi/routers/overwatcher.py index 8d382ac..52e7eb9 100644 --- a/src/lvmapi/routers/overwatcher.py +++ b/src/lvmapi/routers/overwatcher.py @@ -233,6 +233,9 @@ async def route_get_calibrations_list() -> list[OverwatcherCalibrationModel]: "calibrations list", ) + if calibrations_cmd.status.did_fail: + return [] + calibrations = calibrations_cmd.replies.get("calibrations") return [OverwatcherCalibrationModel(**calibration) for calibration in calibrations]