Added tags

This commit is contained in:
Maximilian Giller 2024-05-02 17:49:06 +02:00
parent 8916835654
commit 7b21fa130f

View file

@ -23,7 +23,7 @@ def convert_to_weight(value: int, zero_value: int, scale: float) -> float:
return (value - zero_value) * scale
@router.get("/file")
@router.get("/file", tags=["file"])
async def get_file():
with open(file_path, "r", encoding="UTF-8") as fp:
return HTMLResponse("\n".join(fp.readlines()))
@ -43,12 +43,12 @@ async def add_weight(tl: int, tr: int, bl: int, br: int):
add_line_to_history(f"{str(datetime.now())};{tl};{tr};{bl};{br};{sum};")
@router.post("/delete")
@router.post("/delete", tags=["file"])
async def delete_file():
os.remove(file_path)
@router.post("/zero")
@router.post("/zero", tags=["calibration"])
async def set_zero():
if latest_values is None:
return HTMLResponse(
@ -58,7 +58,7 @@ async def set_zero():
zero_values = latest_values
@router.post("/scales")
@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]