Skip to content

feat: rear heated seats and per-seat heated seat control (#34) - #50

Merged
nanomad merged 1 commit into
SAIC-iSmart-API:developfrom
townsmcp:feat/rear-heated-seats
Oct 25, 2026
Merged

nanomad merged 1 commit into
SAIC-iSmart-API:developfrom
townsmcp:feat/rear-heated-seats

Conversation

@townsmcp

Copy link
Copy Markdown

Closes #34. Part of #26.

Builds on #33's PR, so please merge that one first. Both add lines in the same places (RvcParamsId and the climate API), so I've stacked this one on top to avoid a conflict. Until #33 is merged, this PR also shows its commit.

What it adds

control_heated_seat(vin, *, seat: HeatedSeat, level: int) sets one seat per command, front or rear, as the iSmart app does on an MG S6 EV (UK account, EU servers), from decrypted app traffic:

  • rvcReqType 5, with a single parameter for the chosen seat and no end-of-parameters marker:
Seat Parameter
HeatedSeat.FRONT_LEFT 17
HeatedSeat.FRONT_RIGHT 18
HeatedSeat.REAR_LEFT 25 (new RvcParamsId.HEATED_SEAT_REAR_LEFT)
HeatedSeat.REAR_RIGHT 26 (new RvcParamsId.HEATED_SEAT_REAR_RIGHT)
  • Front seats: 0 off, 1 low, 2 medium, 3 high.
  • Rear seats: on/off only, in the app and in the car. REAR_HEATED_SEAT_ON_LEVEL = 3 is what the app sends for on; 0 is off.
  • Validation: levels outside 0–3 raise ValueError.

The existing control_heated_seats (both front seats in one command) is unchanged.

Rear seat status: BasicVehicleStatus gains secondRowLeftSeatHeatLevel and secondRowRightSeatHeatLevel. The MG S6 EV sends them, but they were dropped because the dataclass had no fields for them. Both default to None, so cars that don't send them are unaffected.

We've been using these in mg-saic-ha on an MG S6 EV since September.

Changes

  • api/vehicle/schema.py: the two RvcParamsId values and the two status fields
  • api/vehicle/climate/schema.py (new): HeatedSeat and REAR_HEATED_SEAT_ON_LEVEL
  • api/vehicle/climate/__init__.py: control_heated_seat()
  • tests/test_heated_seats.py: every seat and level checked byte for byte, the rear "on" level, and the range check
  • tests/test_vehicle_status_rear_seats.py: the rear seat levels are parsed, and stay None when absent
  • README.md: feature list line updated

ruff (check and format), mypy, pylint and pytest all pass locally on Python 3.13.

The front-seat naming fix (17/18 are the physical left/right seats on both LHD and RHD cars, not driver/passenger) will follow as its own PR.

…-API#34)

- control_heated_seat(vin, seat=HeatedSeat.X, level=0-3): one seat per
  command, front or rear, as the iSmart app sends it on an MG S6 EV
  (request type 5, a single parameter 17/18/25/26, no end-of-parameters
  marker). Rear seats are on/off only; REAR_HEATED_SEAT_ON_LEVEL = 3 is
  what the app sends for on. control_heated_seats (both fronts together)
  is unchanged.
- BasicVehicleStatus: secondRowLeftSeatHeatLevel and
  secondRowRightSeatHeatLevel, which the MG S6 EV sends and were dropped.
@nanomad
nanomad force-pushed the feat/rear-heated-seats branch from 112d42b to aa2daa5 Compare October 25, 2026 14:52
@nanomad
nanomad changed the base branch from master to develop October 25, 2026 14:52
@nanomad
nanomad merged commit c05bac4 into SAIC-iSmart-API:develop Oct 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Heated rear seats control (left and right, on/off)

2 participants