Change requests to async

This commit is contained in:
2024-08-21 21:11:29 +02:00
parent b9b8659347
commit b7aaca1650
3 changed files with 28 additions and 24 deletions

View File

@@ -40,7 +40,7 @@ async def get_status() -> dict:
@app.post("/homeassistant/publish")
async def homeassistant_publish(payload: HomeAssistant.Message) -> dict:
return homeassistant.process_message(message=payload)
return await homeassistant.process_message(message=payload)
# Poo recorder
@@ -53,6 +53,6 @@ async def record(record_detail: PooRecordField) -> PooRecordField:
# ticktick
@app.get("/ticktick/auth/code")
async def ticktick_auth(code: str, state: str) -> dict:
if ticktick.retrieve_access_token(code, state):
if await ticktick.retrieve_access_token(code, state):
return {"State": "Token Retrieved"}
return {"State": "Token Retrieval Failed"}