api: connect to CCUJACK MQTT broker on startup
All checks were successful
Build Container / Build Container (push) Successful in 1m29s
All checks were successful
Build Container / Build Container (push) Successful in 1m29s
This commit is contained in:
parent
1a50d67df6
commit
0331dd6406
3 changed files with 17 additions and 2 deletions
|
|
@ -36,11 +36,14 @@ async def lifespan(app: FastAPI):
|
|||
scope=app_cfg.openid_scope,
|
||||
)
|
||||
|
||||
# TODO: regularly re-query CCUJACK to discover new locks
|
||||
app.extra["ccujack"] = CCUJackClient(
|
||||
base_uri=app_cfg.ccujack_url,
|
||||
auth=BasicAuth(app_cfg.ccujack_user, app_cfg.ccujack_password)
|
||||
auth=BasicAuth(app_cfg.ccujack_user, app_cfg.ccujack_password),
|
||||
mqtt_conn=app_cfg.ccujack_mqtt,
|
||||
)
|
||||
await app.extra["ccujack"].find_locks()
|
||||
await app.extra["ccujack"].connect_mqtt()
|
||||
|
||||
yield
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue