Continue work on the Climate Settings
All checks were successful
Golan Testing / testing (1.24.x, ubuntu-latest) (push) Successful in 23s

This commit is contained in:
2025-05-29 15:20:44 -04:00
parent d6ad39b126
commit 48b7379770
3 changed files with 49 additions and 49 deletions

View File

@ -474,49 +474,49 @@ func (c *Client) GetVehicleStatus() {
}
}
// GetClimateSettings .
func (c *Client) GetClimateSettings() {
// {
// "success": true,
// "errorCode": null,
// "dataName": null,
// "data": {
// "climateZoneFrontTemp": "70",
// "runTimeMinutes": "10",
// "climateZoneFrontAirMode": "WINDOW",
// "heatedSeatFrontLeft": "LOW_HEAT",
// "heatedSeatFrontRight": "LOW_HEAT",
// "heatedRearWindowActive": "true",
// "climateZoneFrontAirVolume": "6",
// "outerAirCirculation": "outsideAir",
// "airConditionOn": "false",
// "startConfiguration": "START_ENGINE_ALLOW_KEY_IN_IGNITION"
// }
// }
reqURL := MOBILE_API_VERSION + apiURLs["API_G2_FETCH_CLIMATE_SETTINGS"]
resp := c.execute(reqURL, GET, map[string]string{}, "", false)
// // GetClimateSettings .
// func (c *Client) GetClimateSettings() {
// // {
// // "success": true,
// // "errorCode": null,
// // "dataName": null,
// // "data": {
// // "climateZoneFrontTemp": "70",
// // "runTimeMinutes": "10",
// // "climateZoneFrontAirMode": "WINDOW",
// // "heatedSeatFrontLeft": "LOW_HEAT",
// // "heatedSeatFrontRight": "LOW_HEAT",
// // "heatedRearWindowActive": "true",
// // "climateZoneFrontAirVolume": "6",
// // "outerAirCirculation": "outsideAir",
// // "airConditionOn": "false",
// // "startConfiguration": "START_ENGINE_ALLOW_KEY_IN_IGNITION"
// // }
// // }
// reqURL := MOBILE_API_VERSION + apiURLs["API_G2_FETCH_CLIMATE_SETTINGS"]
// resp := c.execute(reqURL, GET, map[string]string{}, "", false)
respParsed, err := gabs.ParseJSON(resp)
if err != nil {
c.logger.Error("error while parsing json", "request", "GetClimateSettings", "error", err.Error())
}
c.logger.Debug("CLIMATE SETTINGS OUTPUT", "response", respParsed)
// respParsed, err := gabs.ParseJSON(resp)
// if err != nil {
// c.logger.Error("error while parsing json", "request", "GetClimateSettings", "error", err.Error())
// }
// c.logger.Debug("CLIMATE SETTINGS OUTPUT", "response", respParsed)
// ONLY FOR THAT REQUEST BECAUSE OF API SENDS BACK ESCAPING DATA IN DATA FIELD
data, ok := respParsed.Path("data").Data().(string)
// rawIn := json.RawMessage(in)
// bytes, err := rawIn.MarshalJSON()
// if err != nil {
// panic(err)
// }
// // ONLY FOR THAT REQUEST BECAUSE OF API SENDS BACK ESCAPING DATA IN DATA FIELD
// data, ok := respParsed.Path("data").Data().(string)
// // rawIn := json.RawMessage(in)
// // bytes, err := rawIn.MarshalJSON()
// // if err != nil {
// // panic(err)
// // }
// value == string, ok == false
if !ok {
// TODO: Work with errorCode
panic(data)
}
c.logger.Debug("CLIMATE SETTINGS OUTPUT", "body", data)
}
// // value == string, ok == false
// if !ok {
// // TODO: Work with errorCode
// panic(data)
// }
// c.logger.Debug("CLIMATE SETTINGS OUTPUT", "body", data)
// }
// func isPINRequired() {}
// func getVehicles() {}