Added return values for each endpoint
This commit is contained in:
parent
10255b966b
commit
dd3264365c
1 changed files with 4 additions and 0 deletions
|
@ -68,6 +68,7 @@ async def add_weight(tl: int, tr: int, bl: int, br: int):
|
||||||
|
|
||||||
sum = tl + tr + bl + br
|
sum = tl + tr + bl + br
|
||||||
add_line_to_history(f"{str(datetime.now())};{tl};{tr};{bl};{br};{sum};")
|
add_line_to_history(f"{str(datetime.now())};{tl};{tr};{bl};{br};{sum};")
|
||||||
|
return "Added data"
|
||||||
|
|
||||||
|
|
||||||
@router.post("/latest")
|
@router.post("/latest")
|
||||||
|
@ -87,6 +88,7 @@ async def get_latest():
|
||||||
@router.post("/delete", tags=["file"])
|
@router.post("/delete", tags=["file"])
|
||||||
async def delete_file():
|
async def delete_file():
|
||||||
os.remove(file_path)
|
os.remove(file_path)
|
||||||
|
return "Deleted file"
|
||||||
|
|
||||||
|
|
||||||
@router.post("/zero", tags=["calibration"])
|
@router.post("/zero", tags=["calibration"])
|
||||||
|
@ -97,12 +99,14 @@ async def set_zero():
|
||||||
)
|
)
|
||||||
global zero_values
|
global zero_values
|
||||||
zero_values = latest_values
|
zero_values = latest_values
|
||||||
|
return "Set zeroes to: " + " | ".join(str(v) for v in zero_values)
|
||||||
|
|
||||||
|
|
||||||
@router.post("/scales", tags=["calibration"])
|
@router.post("/scales", tags=["calibration"])
|
||||||
async def set_scales(tl: float, tr: float, bl: float, br: float):
|
async def set_scales(tl: float, tr: float, bl: float, br: float):
|
||||||
global scale_values
|
global scale_values
|
||||||
scale_values = [tl, tr, bl, br]
|
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):
|
if not os.path.exists(file_path):
|
||||||
|
|
Loading…
Reference in a new issue