diff --git a/client.go b/client.go index 6a8dae8..2547562 100644 --- a/client.go +++ b/client.go @@ -467,7 +467,7 @@ func (c *Client) GetVehicleStatus() { } } -// GetVehicleStatus . +// GetClimateSettings . func (c *Client) GetClimateSettings() { // { // "success": true, @@ -559,16 +559,13 @@ func (c *Client) execute(requestUrl string, method string, params map[string]str if err != nil { c.logger.Error("error while getting body", "error", err.Error()) } - fmt.Printf("RESP BODY: %s\n", string(resBytes)) - // if err != nil { - // fmt.Println(err) - // return - // } + respParsed, err := gabs.ParseJSON(resBytes) if err != nil { c.logger.Error("error which parsing json", "request", "execute", "method", method, "url", requestUrl, "error", err.Error()) } - c.logger.Debug("HTTP OUTPUT", "body", string(resBytes)) + + // c.logger.Debug("HTTP OUTPUT", "body", string(resBytes)) _, ok := respParsed.Path("success").Data().(bool) // value == string, ok == false @@ -623,7 +620,6 @@ func (c *Client) execute(requestUrl string, method string, params map[string]str time.Sleep(3 * time.Second) } } - // fmt.Printf("[DEBUG] HTTP OUTPUT >> %v\n", string([]byte(resp.Body()))) return resBytes }