From 0e5b9aae19079c5579d072742b49a1353e441df6 Mon Sep 17 00:00:00 2001 From: Alex Savin Date: Mon, 21 Jul 2025 19:11:31 -0400 Subject: [PATCH] Add new feature status mappings and update run time validation in vehicle functions --- consts.go | 6 ++++++ vehicle.go | 14 ++------------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/consts.go b/consts.go index ba217f8..ebb0ff3 100644 --- a/consts.go +++ b/consts.go @@ -161,6 +161,12 @@ var features = map[string]string{ "RCC": "Remote Climate Control", "ACCS": "Adaptive Cruise Control", "SXM360L": "SiriusXM with 360L", + "WDWSTAT": "Window Status", + "MOONSTAT": "Moonroof Status", + "RTGU": "Remote Trunk / Rear Gate Unlock", + "RVFS": "Remote Vehicle Find System", + "TLD": "Tire Pressure Low Detection", + "DOOR_LU_STAT": "Door Lock/Unlock Status", } var troubles = map[string]string{ diff --git a/vehicle.go b/vehicle.go index f84f856..248a4ec 100644 --- a/vehicle.go +++ b/vehicle.go @@ -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)