diff --git a/vehicle.go b/vehicle.go index 8fc0fdb..7c64edb 100644 --- a/vehicle.go +++ b/vehicle.go @@ -150,7 +150,7 @@ type Tire struct { Position string SubPosition string Pressure int - PressurePsi string + PressurePsi int Status string Updated time.Time } @@ -777,7 +777,7 @@ func (v *Vehicle) getAPIGen() string { // } // isEV . -// Get whether the specified VIN is an Electric Vehicle. +// Get whether the specified car is an Electric Vehicle. func (v *Vehicle) isEV() bool { return contains(v.Features, FEATURE_PHEV) } @@ -822,7 +822,7 @@ func (v *Vehicle) parseLock(prefix, suffix, name string, value any) { pos := strings.TrimPrefix(name, prefix) pos = strings.TrimSuffix(pos, suffix) submatchall := re.FindAllString(pos, -1) - // v.client.logger.Debug("VEHICLE COND", "key", name, "value", value, "number", len(submatchall)) + v.client.logger.Debug("door lock status", "key", name, "value", value, "number", len(submatchall)) if door, ok := v.Doors[pos]; ok { door.Lock = value.(string) @@ -880,14 +880,14 @@ func (v *Vehicle) parseTire(prefix, suffix, name string, value any) { // v.client.logger.Debug("VEHICLE COND", "key", name, "data", value, "number", len(submatchall)) if tire, ok := v.Tires[pos]; ok { - tire.PressurePsi = value.(string) + tire.PressurePsi = value.(int) tire.Updated = time.Now() } else { - tire.PressurePsi = value.(string) + tire.PressurePsi = value.(int) tire.Updated = time.Now() v.Tires[pos] = Tire{ Position: submatchall[0], - PressurePsi: value.(string), + PressurePsi: value.(int), Updated: time.Now(), } if len(submatchall) >= 2 {