More changes
All checks were successful
Golan Testing / testing (1.24.x, ubuntu-latest) (push) Successful in 24s

This commit is contained in:
2025-06-04 09:16:17 -04:00
parent f7c17b8bbf
commit 83e453cc7e

View File

@ -150,7 +150,7 @@ type Tire struct {
Position string Position string
SubPosition string SubPosition string
Pressure int Pressure int
PressurePsi string PressurePsi int
Status string Status string
Updated time.Time Updated time.Time
} }
@ -777,7 +777,7 @@ func (v *Vehicle) getAPIGen() string {
// } // }
// isEV . // isEV .
// Get whether the specified VIN is an Electric Vehicle. // Get whether the specified car is an Electric Vehicle.
func (v *Vehicle) isEV() bool { func (v *Vehicle) isEV() bool {
return contains(v.Features, FEATURE_PHEV) 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.TrimPrefix(name, prefix)
pos = strings.TrimSuffix(pos, suffix) pos = strings.TrimSuffix(pos, suffix)
submatchall := re.FindAllString(pos, -1) 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 { if door, ok := v.Doors[pos]; ok {
door.Lock = value.(string) 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)) // v.client.logger.Debug("VEHICLE COND", "key", name, "data", value, "number", len(submatchall))
if tire, ok := v.Tires[pos]; ok { if tire, ok := v.Tires[pos]; ok {
tire.PressurePsi = value.(string) tire.PressurePsi = value.(int)
tire.Updated = time.Now() tire.Updated = time.Now()
} else { } else {
tire.PressurePsi = value.(string) tire.PressurePsi = value.(int)
tire.Updated = time.Now() tire.Updated = time.Now()
v.Tires[pos] = Tire{ v.Tires[pos] = Tire{
Position: submatchall[0], Position: submatchall[0],
PressurePsi: value.(string), PressurePsi: value.(int),
Updated: time.Now(), Updated: time.Now(),
} }
if len(submatchall) >= 2 { if len(submatchall) >= 2 {