Skip to content

feat: add Brandt Smart Control authentication#2140

Merged
iMicknl merged 6 commits into
mainfrom
feat/brandt-auth
Jun 19, 2026
Merged

feat: add Brandt Smart Control authentication#2140
iMicknl merged 6 commits into
mainfrom
feat/brandt-auth

Conversation

@iMicknl

@iMicknl iMicknl commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add a dedicated BrandtAuthStrategy implementing Brandt's two-layer auth: log in to the Smart Control middleware (smartcontrol-app.com, a cookie-session Rails API), fetch a JWT using the resulting session cookie, then log in to the Overkiz cloud with jwt=<JWT> only.
  • The two middleware calls share the client's aiohttp.ClientSession cookie jar, so the JWT GET is authenticated purely by the session cookie set on login.
  • Add BRANDT_MIDDLEWARE_API / BRANDT_PARTNER constants and BrandtBadCredentialsError / BrandtServiceError exceptions, following the Cozytouch/Nexity precedent.
  • Route Server.BRANDT to the new strategy in the auth factory (it previously fell through to the generic SessionLoginStrategy and silently failed).
  • Update README/docs: Brandt is now supported, removing the obsolete "authentication not supported" footnote.

Test Plan

  • pytest tests/test_auth.py — new TestBrandtAuthStrategy (success flow, bad credentials, missing JWT) + factory routing test, all passing
  • Full suite: 546 passed
  • ruff + ty clean
  • Optional: live verification against a real Brandt account (the Smart Control app is discontinued; the service may no longer be operational)

@iMicknl iMicknl requested a review from tetienne as a code owner June 19, 2026 08:09
@iMicknl iMicknl merged commit 323b433 into main Jun 19, 2026
11 checks passed
@iMicknl iMicknl deleted the feat/brandt-auth branch June 19, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant