Small fixes

This commit is contained in:
Maximilian Giller 2023-10-11 01:36:27 +02:00
parent 22353f34ab
commit 592d87019a

View file

@ -32,6 +32,22 @@ async def start_time_loop():
return {"message": "Time loop started"}
@app.post("/off")
async def turn_off():
global should_run_time_loop
should_run_time_loop = False
matrix_display.turn_off()
return {"message": "Display turned off"}
@app.post("/flash")
async def flash(count: int = 1):
global should_run_time_loop
should_run_time_loop = False
matrix_display.flash(count)
return {"message": "Display flashed"}
@app.post("/message")
async def display_message(body: dict):
global should_run_time_loop