Add new feature status mappings and update run time validation in vehicle functions
All checks were successful
Golan Testing / testing (1.24.x, ubuntu-latest) (push) Successful in 23s

This commit is contained in:
2025-07-21 19:11:31 -04:00
parent 3809ed5883
commit 0e5b9aae19
2 changed files with 8 additions and 12 deletions

View File

@ -202,8 +202,8 @@ func (v *Vehicle) Unlock() (chan string, error) {
// EngineStart
// Sends a command to start engine and set climate control.
func (v *Vehicle) EngineStart(run, delay int, horn bool) (chan string, error) {
if run < 1 || run > 10 {
return nil, errors.New("run time must be between 1 and 10 minutes")
if slices.Contains([]int{0, 1, 5, 10}, run) {
return nil, errors.New("run time must be 0, 1, 5 or 10 minutes")
}
var startConfig string
@ -542,16 +542,6 @@ func (v *Vehicle) UpdateClimateQuickPresets() error {
"outerAirCirculation": "outsideAir", // outsideAir | recirculation
"airConditionOn": "false", // boolean
"startConfiguration": "START_ENGINE_ALLOW_KEY_IN_IGNITION", // START_ENGINE_ALLOW_KEY_IN_IGNITION | ONLY FOR PHEV > START_CLIMATE_CONTROL_ONLY_ALLOW_KEY_IN_IGNITION
// "presetType": "userPreset",
// "climateZoneFrontTemp": "65",
// "climateZoneFrontAirMode": "FEET_FACE_BALANCED",
// "climateZoneFrontAirVolume": "5",
// "outerAirCirculation": "outsideAir",
// "heatedRearWindowActive": "false",
// "heatedSeatFrontLeft": "HIGH_COOL",
// "airConditionOn": "false",
// "startConfiguration": "START_ENGINE_ALLOW_KEY_IN_IGNITION",
}
reqUrl := MOBILE_API_VERSION + apiURLs["API_G2_SAVE_RES_QUICK_START_SETTINGS"]
resp, _ := v.client.execute(POST, reqUrl, params, true)