Compare commits
2 Commits
28f650dc7d
...
a42ed54f38
Author | SHA1 | Date | |
---|---|---|---|
a42ed54f38 | |||
c27e5adfe0 |
23
vehicle.go
23
vehicle.go
@ -700,7 +700,10 @@ func (v *Vehicle) GetVehicleHealth() {
|
|||||||
// v.client.logger.Debug("vehicle health item", "id", i, "item", vhi)
|
// v.client.logger.Debug("vehicle health item", "id", i, "item", vhi)
|
||||||
if vhi.IsTrouble {
|
if vhi.IsTrouble {
|
||||||
if _, ok := troubles[vhi.FeatureCode]; ok {
|
if _, ok := troubles[vhi.FeatureCode]; ok {
|
||||||
// TODO: Added a troble to the trouble list
|
t := Trouble{
|
||||||
|
Description: troubles[vhi.FeatureCode],
|
||||||
|
}
|
||||||
|
v.Troubles[vhi.FeatureCode] = t
|
||||||
v.client.logger.Debug("found troubled vehicle health item", "id", i, "item", vhi.FeatureCode, "description", troubles[vhi.FeatureCode])
|
v.client.logger.Debug("found troubled vehicle health item", "id", i, "item", vhi.FeatureCode, "description", troubles[vhi.FeatureCode])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -831,10 +834,11 @@ func (v *Vehicle) parseParts(name string, value any) {
|
|||||||
}
|
}
|
||||||
case "Tire", "tire":
|
case "Tire", "tire":
|
||||||
if t, ok := v.Tires[pn]; ok {
|
if t, ok := v.Tires[pn]; ok {
|
||||||
if grps[4] == "Psi" {
|
switch v := value.(type) {
|
||||||
t.PressurePsi = value.(int)
|
case int:
|
||||||
} else {
|
t.PressurePsi = v
|
||||||
t.Pressure = int(value.(float64))
|
case float64:
|
||||||
|
t.PressurePsi = int(v)
|
||||||
}
|
}
|
||||||
t.Updated = time.Now()
|
t.Updated = time.Now()
|
||||||
v.Tires[pn] = t
|
v.Tires[pn] = t
|
||||||
@ -844,10 +848,11 @@ func (v *Vehicle) parseParts(name string, value any) {
|
|||||||
SubPosition: grps[3],
|
SubPosition: grps[3],
|
||||||
Updated: time.Now(),
|
Updated: time.Now(),
|
||||||
}
|
}
|
||||||
if grps[4] == "Psi" {
|
switch v := value.(type) {
|
||||||
t.PressurePsi = value.(int)
|
case int:
|
||||||
} else {
|
t.PressurePsi = v
|
||||||
t.Pressure = int(value.(float64))
|
case float64:
|
||||||
|
t.PressurePsi = int(v)
|
||||||
}
|
}
|
||||||
v.Tires[pn] = t
|
v.Tires[pn] = t
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user