Async shit
This commit is contained in:
parent
d58f37b679
commit
6bf7f7525e
1 changed files with 3 additions and 3 deletions
|
@ -36,7 +36,7 @@ async def start_time_loop():
|
|||
async def turn_off():
|
||||
global should_run_time_loop
|
||||
should_run_time_loop = False
|
||||
matrix_display.turn_off()
|
||||
asyncio.create_task(lambda: matrix_display.turn_off())
|
||||
return {"message": "Display turned off"}
|
||||
|
||||
|
||||
|
@ -44,7 +44,7 @@ async def turn_off():
|
|||
async def flash(count: int = 1):
|
||||
global should_run_time_loop
|
||||
should_run_time_loop = False
|
||||
matrix_display.flash(count)
|
||||
asyncio.create_task(lambda: matrix_display.flash(count))
|
||||
return {"message": "Display flashed"}
|
||||
|
||||
|
||||
|
@ -54,7 +54,7 @@ async def display_message(body: dict):
|
|||
should_run_time_loop = False
|
||||
message_text = body.get("message")
|
||||
try:
|
||||
matrix_display.show_text(message_text)
|
||||
asyncio.create_task(lambda: matrix_display.show_text(message_text))
|
||||
except requests.exceptions.RequestException as e:
|
||||
raise HTTPException(
|
||||
status_code=500,
|
||||
|
|
Loading…
Reference in a new issue