api: connect to CCUJACK MQTT broker on startup
All checks were successful
Build Container / Build Container (push) Successful in 1m29s

This commit is contained in:
lilly 2026-05-19 09:34:51 +02:00
commit 0331dd6406
Signed by: lilly
SSH key fingerprint: SHA256:y9T5GFw2A20WVklhetIxG1+kcg/Ce0shnQmbu1LQ37g
3 changed files with 17 additions and 2 deletions

View file

@ -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