From 592d87019a1a913e8c3c66b475cab8fb4c30694b Mon Sep 17 00:00:00 2001 From: Maximilian Giller Date: Wed, 11 Oct 2023 01:36:27 +0200 Subject: [PATCH] Small fixes --- src/main.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main.py b/src/main.py index fa0a66f..0d77cd5 100644 --- a/src/main.py +++ b/src/main.py @@ -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