Repository navigation
feat: window ventilation - close, ventilate or fully open door windows (#36) - #53
Conversation
SAIC-iSmart-API#36) control_door_windows(vin, action=DoorWindowsAction.CLOSE/VENTILATE/OPEN) sends what the iSmart app sends on an MG S6 EV (decrypted app traffic): request type 3, the sunroof parameter 0 (left alone), all four door windows 1, then the action (0 close, 1 ventilate, 2 fully open), with no end-of-parameters marker. control_windows is unchanged for other models (its open value, 3, isn't used by the MG S6 EV).
|
Thanks for merging @nanomad. Good question. I've only tested it on my right-hand drive MG S6 EV (UK), not on a left-hand drive car. I don't think it can have the #51 problem though: Where the driver/passenger naming does bite is the window status: the car reports the front windows as If anyone with a LHD car can try ventilate / open / close, it would be good to have that confirmed too. |
Closes #36. Part of #26.
Adds
control_door_windows(vin, *, action: DoorWindowsAction), which closes, ventilates (opens a few centimetres) or fully opens all four door windows together. This is the iSmart app's "Ventilation" control.What it sends
Taken from decrypted iSmart app traffic on an MG S6 EV (UK account, EU servers).
rvcReqType3 with:0, left alone1each0close,1ventilate,2fully openThere's no end-of-parameters marker, matching the app.
Notes
control_windowsis unchanged. It sends3as its open value, which the MG S6 EV doesn't use, so the new method sits alongside it rather than changing it for other models.We've been using this in mg-saic-ha on an MG S6 EV since September.
Changes
api/vehicle/windows/schema.py:DoorWindowsAction(CLOSE/VENTILATE/OPEN)api/vehicle/windows/__init__.py:control_door_windows()tests/test_door_windows.py: each action checked byte for byte, pluscontrol_windowsunchangedREADME.md: feature list lineThis one doesn't depend on the heated seat PRs and can be merged in any order. ruff (check and format), mypy, pylint and pytest all pass locally on Python 3.13.