Repository navigation
feat: Add Sauter Smart Control realm - #2304
Conversation
093fad1 to
95f6102
Compare
iMicknl
left a comment
There was a problem hiding this comment.
Thanks for your contribution! Have you verified that this works for your account?
And are you planning to use this via the python-overkiz-api, or via Home Assistant? We don't support ovens there yet afaik.
|
Hello, Yes, tested on my own account. The only difference with Brandt is the partner field ( On the HA side: that's the end goal, but I saw #177263 (climate for ogp:Oven) got closed after the author went inactive. You'd asked there for the full oven diagnostics. I have a real Sauter oven, so here's the structure from the live API: |
iMicknl
left a comment
There was a problem hiding this comment.
Thanks, and nice that you tested it on a real oven!
One thing outside the diff: add a Sauter Smart Control row to the supported hubs table in README.md and docs/index.md.
Sauter Smart Control runs on the same Overkiz host (ha3-1) and the same
smartcontrol-app.com cookie-session middleware as Brandt Smart Control, but
authenticates against a different partner/realm ("sauter-electromenager").
Without this, Sauter accounts fail the Brandt flow with BrandtBadCredentialsError.
- enums.Server.SAUTER_SMART_CONTROL
- const: SAUTER_PARTNER + Server.SAUTER_SMART_CONTROL ServerConfig (ha3-1)
- auth: BrandtAuthStrategy gains a `partner` attribute (default BRANDT_PARTNER,
Brandt unchanged); SauterAuthStrategy subclasses it with SAUTER_PARTNER;
factory wires Server.SAUTER_SMART_CONTROL; service-error messages use
self.server.name so they read correctly for Sauter
- tests: Brandt login tests parametrized over Brandt + Sauter
- README.md + docs/index.md: Sauter Smart Control hubs row
Refs: iMicknl#1202
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
95f6102 to
4c0f0e7
Compare
## Why The docs workflow has been failing since the pymdown-extensions 12.1 → 12.2 bump (#2291), on `main` (v2.2.3 release run) and on open PRs like #2304: ``` mkdocstrings/_internal/handlers/rendering.py:85, in Highlighter.__init__ TypeError: Highlight.__init__() missing 1 required positional argument: 'md' ``` pymdown-extensions 12.2 made `md` a required argument of `pymdownx.highlight.Highlight.__init__`. mkdocstrings 1.0.4 subclasses it without passing `md`. ## What - Lockfile-only bump of mkdocstrings 1.0.4 → 1.0.8, which supports the new signature. `pyproject.toml` floors are unchanged. - Add `uv.lock` to the docs workflow `pull_request` paths, so lockfile-only bumps like #2291 run the docs build (that is how this slipped through). ## Testing - `uv run mkdocs build` succeeds (failed with the `TypeError` before). - `prek run --all-files` and `pytest` pass.
`BrandtAuthStrategy.login()` treated every status >= 400 from the middleware `sessions.json` call as bad credentials, including 5xx. During a Brandt middleware outage, Home Assistant would therefore ask the user to reauthenticate instead of retrying. A non-JSON error body (for example an HTML page from a proxy) also leaked a raw `aiohttp.ContentTypeError`, because it is not a `ValueError`. Changes: - `sessions.json` and `profile/jwt.json` now call `_raise_for_server_error` first, like the Cozytouch and Somfy strategies, so 5xx raises `ServiceUnavailableError` / `MaintenanceError`. - The `sessions.json` error body is read with `_json_body`, so a non-JSON 4xx still raises `BrandtBadCredentialsError`. The first `error` entry is still used as the message. - Added tests for a 503 from `sessions.json`, a non-JSON 401, and a 503 from `jwt.json`. This also affects the upcoming Sauter Smart Control realm (#2304), which uses the same middleware login.
|
Thanks a lot for merging this, @iMicknl, and for getting it into 2.3.0 so fast. While I was at it I looked at exposing the oven itself in the HA integration and found #177263 (climate support for ogp:Oven). It went stale, and I saw your steer that an oven most likely can't be a climate entity, with the number/select/button approach from home-assistant/core#173326 being the way to go. I'd be glad to pick that up and see it through review. I also have full diagnostics for a Sauter ogp:Oven (the structure you asked the previous author for): 13 commands, ~37 states, AvailableModes/AvailableRecipes, etc. Happy to post a redacted dump. How would you recommend approaching it? Thanks again! |
|
@Mincka are you willing to create a PR on core with the required changes for your device? I won't be able to prioritize this and it is hard for me to build this without testing. |
|
I can give it a shot but I wanted your advice on the approach. |
|
Yes, take home-assistant/core#173326 (review) as guidance. Using the climate entity for ovens won't be accepted in core. |
Add Sauter Smart Control realm (
Server.SAUTER)Why
Sauter Smart Control (the connected-appliance app for Sauter ovens, by Groupe
Brandt / Modulotech) runs on the same Overkiz backend and the same
smartcontrol-app.comcookie‑session middleware as Brandt Smart Control — but itauthenticates against a different partner/realm:
sauter-electromenager(Brandt uses
brandt-electromenager).Because of that, a Sauter account currently cannot be used: the Brandt flow returns
BrandtBadCredentialsError("Password wrong password"), since the middleware sessionlogin (
POST /api/v1/sessions.json) is sent with the wrongpartner. This is themissing piece from #1202.
What
Adds first-class support so Sauter connected appliances (e.g. the SOP6615LB oven,
an Overkiz OGP gateway) can authenticate and be controlled:
enums.Server.SAUTERconst:SAUTER_PARTNER = "sauter-electromenager"and aServer.SAUTERServerConfig(endpointhttps://ha3-1.overkiz.com/enduser-mobile-web/enduserAPI/,same host as Brandt)
auth:BrandtAuthStrategygains apartnerclass attribute (defaultBRANDT_PARTNER, so Brandt behaviour is unchanged);SauterAuthStrategysubclasses it with
SAUTER_PARTNER; the factory wiresServer.SAUTERmiddleware login asserting
partner=sauter-electromenager)The only functional difference from Brandt is the
partnervalue; everything else(JWT fetch via the session cookie, then the Overkiz
loginwith thejwt) is reused.Testing
ruffclean on the changed lines; full test suite green (513 passed, 2 skipped),including the 3 new Sauter tests.
Server.SAUTERlogs in, lists the gateway + oven, reads states, and executescommands (e.g.
stop).Notes
Server.SAUTER_COZYTOUCH(ha110-1) already exists but targets the Sauter heating /Cozytouch realm — this is the distinct Smart Control appliance realm (ha3-1).
existing owners keep using their appliances via this library / Home Assistant.
Refs: #1202