Continue work on the Climate Settings
All checks were successful
Golan Testing / testing (1.24.x, ubuntu-latest) (push) Successful in 23s
All checks were successful
Golan Testing / testing (1.24.x, ubuntu-latest) (push) Successful in 23s
This commit is contained in:
80
client.go
80
client.go
@ -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() {}
|
||||
|
Reference in New Issue
Block a user