api: automatically rediscover locks from CCUJack
All checks were successful
Build Container / Build Container (push) Successful in 1m35s
All checks were successful
Build Container / Build Container (push) Successful in 1m35s
closes CCCHH/dooris#5
This commit is contained in:
parent
b1b624a7b3
commit
2349e58924
3 changed files with 24 additions and 5 deletions
|
|
@ -1,7 +1,6 @@
|
|||
from typing import Optional, List, AsyncIterable
|
||||
import logging
|
||||
import secrets
|
||||
import sys
|
||||
from datetime import datetime, UTC
|
||||
from fastapi import FastAPI, Request, Response, status
|
||||
from fastapi.responses import RedirectResponse
|
||||
|
|
@ -36,8 +35,7 @@ async def lifespan(app: FastAPI):
|
|||
auth=BasicAuth(app_cfg.ccujack_user, app_cfg.ccujack_password),
|
||||
mqtt_conn=app_cfg.ccujack_mqtt,
|
||||
)
|
||||
await app.extra["ccujack"].connect_mqtt()
|
||||
await app.extra["ccujack"].find_locks()
|
||||
await app.extra["ccujack"].start()
|
||||
|
||||
yield
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue