From 10255b966b93852c5b62d0fbd3881415d7fc50ab Mon Sep 17 00:00:00 2001 From: Maximilian Giller Date: Thu, 2 May 2024 18:02:03 +0200 Subject: [PATCH] Fixed data missing case --- src/endpoints/bettwaage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/endpoints/bettwaage.py b/src/endpoints/bettwaage.py index 51a1b60..db61e12 100644 --- a/src/endpoints/bettwaage.py +++ b/src/endpoints/bettwaage.py @@ -10,7 +10,7 @@ router = APIRouter() file_path = "bettwaage.csv" -latest_values = None +latest_values = [] zero_values = [0, 0, 0, 0] scale_values = [1, 1, 1, 1] @@ -91,7 +91,7 @@ async def delete_file(): @router.post("/zero", tags=["calibration"]) async def set_zero(): - if latest_values is None: + if not latest_values: return HTMLResponse( status_code=400, content="Requiring data before setting zeros." )