A new way to trimm
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:
14
vehicle.go
14
vehicle.go
@ -482,11 +482,15 @@ func (v *Vehicle) GetClimatePresets() {
|
||||
|
||||
v.client.logger.Debug("subaru climate presets http output", "body", resp)
|
||||
|
||||
tmp := strings.Replace(string(resp), `\\\"`, `"`, -1)
|
||||
tmp = strings.Replace(tmp, `}\",\"{`, `},{`, -1)
|
||||
tmp = strings.Replace(tmp, `[\"{`, `[{`, -1)
|
||||
tmp = strings.Replace(tmp, ` }\"]`, `}]`, -1)
|
||||
tmp = strings.Replace(tmp, `\"`, `"`, -1)
|
||||
tmp := strings.ReplaceAll(string(resp), `\\\"`, `"`)
|
||||
v.client.logger.Debug("subaru climate presets after trimming #1", "body", tmp)
|
||||
tmp = strings.ReplaceAll(tmp, `}\",\"{`, `},{`)
|
||||
v.client.logger.Debug("subaru climate presets after trimming #2", "body", tmp)
|
||||
tmp = strings.ReplaceAll(tmp, `[\"{`, `[{`)
|
||||
v.client.logger.Debug("subaru climate presets after trimming #3", "body", tmp)
|
||||
tmp = strings.ReplaceAll(tmp, ` }\"]`, `}]`)
|
||||
v.client.logger.Debug("subaru climate presets after trimming #4", "body", tmp)
|
||||
tmp = strings.ReplaceAll(tmp, `\"`, `"`)
|
||||
|
||||
v.client.logger.Debug("subaru climate presets after trimming", "body", tmp)
|
||||
|
||||
|
Reference in New Issue
Block a user