From dd3264365c89f326022fdd7de40d8787738d969d Mon Sep 17 00:00:00 2001 From: Maximilian Giller Date: Thu, 2 May 2024 18:03:44 +0200 Subject: [PATCH] Added return values for each endpoint --- src/endpoints/bettwaage.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/endpoints/bettwaage.py b/src/endpoints/bettwaage.py index db61e12..cc319c5 100644 --- a/src/endpoints/bettwaage.py +++ b/src/endpoints/bettwaage.py @@ -68,6 +68,7 @@ async def add_weight(tl: int, tr: int, bl: int, br: int): sum = tl + tr + bl + br add_line_to_history(f"{str(datetime.now())};{tl};{tr};{bl};{br};{sum};") + return "Added data" @router.post("/latest") @@ -87,6 +88,7 @@ async def get_latest(): @router.post("/delete", tags=["file"]) async def delete_file(): os.remove(file_path) + return "Deleted file" @router.post("/zero", tags=["calibration"]) @@ -97,12 +99,14 @@ async def set_zero(): ) global zero_values zero_values = latest_values + return "Set zeroes to: " + " | ".join(str(v) for v in zero_values) @router.post("/scales", tags=["calibration"]) async def set_scales(tl: float, tr: float, bl: float, br: float): global scale_values scale_values = [tl, tr, bl, br] + return "Set zeroes to: " + " | ".join(str(v) for v in scale_values) if not os.path.exists(file_path):