Skip to content

feat: ventilated seat control and status (#35) - #59

Open
nanomad wants to merge 2 commits into
developfrom
feat/ventilated-seats
Open

nanomad wants to merge 2 commits into
developfrom
feat/ventilated-seats

Conversation

@nanomad

@nanomad nanomad commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Closes #35. Part of #26.

Adds control_ventilated_seat(vin, *, seat: VentilatedSeat, level: int), which sets one ventilated seat per command, front or rear. It mirrors control_heated_seat.

What it sends

  • rvcReqType 22 (new RvcReqType.VENTILATED_SEATS).
  • A single parameter for the chosen seat, then the end-of-parameters marker (255, value 0):
Seat Parameter
VentilatedSeat.FRONT_LEFT 27
VentilatedSeat.FRONT_RIGHT 28
VentilatedSeat.REAR_LEFT 29
VentilatedSeat.REAR_RIGHT 30
  • Levels: 0 is off. Seats with several levels take 1, 2 or 3. Seats with a single level take ONE_LEVEL_VENTILATED_SEAT_ON_LEVEL (3) for on. Levels outside 0-3 raise ValueError.
  • Status: BasicVehicleStatus gains frontLeftSeatVentLevel, frontRightSeatVentLevel, secondRowLeftSeatVentLevel and secondRowRightSeatVentLevel. They default to None, so cars without ventilated seats are unaffected.
  • Sides: left and right are physical sides, as for the heated seats.

Draft: not tested on a car

The values come from static analysis of the iSmart app, not from a capture. This PR has not been checked on a car. Things only a car can settle:

  • Whether the car accepts these values, and whether levels 1 and 2 differ on multi-level seats.
  • Whether the car needs the trailing 255, and whether an omitted seat is held or cleared.
  • Whether heat and ventilation exclude each other on the same seat. The commands don't couple them.
  • Which cars offer front or rear ventilated seats. The client doesn't check capabilities, so callers should.

Please test on a car with ventilated seats (the issue reporter's MG S6?) before this is marked ready.

Changes

  • api/vehicle/schema.py: four RvcParamsId values, RvcReqType.VENTILATED_SEATS and four status fields
  • api/vehicle/climate/schema.py: VentilatedSeat and ONE_LEVEL_VENTILATED_SEAT_ON_LEVEL
  • api/vehicle/climate/__init__.py: control_ventilated_seat()
  • tests/test_ventilated_seats.py: every seat and level byte for byte, the one-level on value, the range check and the status parsing
  • README.md: feature list line

ruff, mypy and pytest pass locally on Python 3.13.

https://claude.ai/code/session_013xKSpu8ev4cxQNsitcCidm

control_ventilated_seat(vin, seat=VentilatedSeat.X, level=0-3) sets one seat per command, front or rear: request type 22, a single parameter (27 front left, 28 front right, 29 rear left, 30 rear right), then PARAMS_MAX. BasicVehicleStatus gets frontLeft/frontRight/secondRowLeft/secondRowRight SeatVentLevel. Based on static analysis of the iSmart app, not checked on a car.
@nanomad

nanomad commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

@townsmcp I'm planning to merge as-is, if you manage to get a RHD tester on your end we can re-evaluate enums for LEFT/RIGHT

@nanomad
nanomad marked this pull request as ready for review November 12, 2026 15:39
@nanomad

nanomad commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

On hold. Tested on an MG S6 EV (see #35): the car rejects request type 22 with code 4, with or without the 255 marker, and the status has no vent fields. The conflict with develop is resolved locally but not pushed yet. We'll revisit once there's a capture of a command that works.

This branch has not been deployed

No deployments
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.

1 participant