Change requests to async
This commit is contained in:
@@ -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"}
|
||||
|
||||
Reference in New Issue
Block a user