More changes
All checks were successful
Golan Testing / testing (1.24.x, ubuntu-latest) (push) Successful in 24s
All checks were successful
Golan Testing / testing (1.24.x, ubuntu-latest) (push) Successful in 24s
This commit is contained in:
46
vehicle.go
46
vehicle.go
@ -628,7 +628,7 @@ func (v *Vehicle) GetVehicleStatus() {
|
||||
|
||||
// for i := 0; i < val.NumField(); i++ {
|
||||
for i := range val.NumField() {
|
||||
v.client.logger.Debug("vehicle status >> parsing a car part", "field", typeOfS.Field(i).Name, "value", val.Field(i).Interface(), "type", val.Field(i).Type())
|
||||
// v.client.logger.Debug("vehicle status >> parsing a car part", "field", typeOfS.Field(i).Name, "value", val.Field(i).Interface(), "type", val.Field(i).Type())
|
||||
if slices.Contains(badValues, val.Field(i).Interface()) {
|
||||
continue
|
||||
} else {
|
||||
@ -796,12 +796,11 @@ func (v *Vehicle) parseDoor(prefix, suffix, name string, value any) {
|
||||
submatchall := re.FindAllString(pos, -1)
|
||||
// v.client.logger.Debug("VEHICLE COND", "key", name, "value", value, "number", len(submatchall))
|
||||
|
||||
if door, ok := v.Doors[pos]; ok {
|
||||
door.Status = value.(string)
|
||||
door.Updated = time.Now()
|
||||
if d, ok := v.Doors[pos]; ok {
|
||||
d.Status = value.(string)
|
||||
d.Updated = time.Now()
|
||||
v.Doors[pos] = d
|
||||
} else {
|
||||
door.Status = value.(string)
|
||||
door.Updated = time.Now()
|
||||
v.Doors[pos] = Door{
|
||||
Position: submatchall[0],
|
||||
Status: value.(string),
|
||||
@ -824,11 +823,11 @@ func (v *Vehicle) parseLock(prefix, suffix, name string, value any) {
|
||||
submatchall := re.FindAllString(pos, -1)
|
||||
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)
|
||||
if d, ok := v.Doors[pos]; ok {
|
||||
d.Lock = value.(string)
|
||||
d.Updated = time.Now()
|
||||
v.Doors[pos] = d
|
||||
} else {
|
||||
door.Lock = value.(string)
|
||||
door.Updated = time.Now()
|
||||
v.Doors[pos] = Door{
|
||||
Position: submatchall[0],
|
||||
Lock: value.(string),
|
||||
@ -851,12 +850,11 @@ func (v *Vehicle) parseWindow(prefix, suffix, name string, value any) {
|
||||
submatchall := re.FindAllString(pos, -1)
|
||||
// v.client.logger.Debug("VEHICLE COND", "key", name, "data", value, "number", len(submatchall))
|
||||
|
||||
if window, ok := v.Windows[pos]; ok {
|
||||
window.Status = value.(string)
|
||||
window.Updated = time.Now()
|
||||
if w, ok := v.Windows[pos]; ok {
|
||||
w.Status = value.(string)
|
||||
w.Updated = time.Now()
|
||||
v.Windows[pos] = w
|
||||
} else {
|
||||
window.Status = value.(string)
|
||||
window.Updated = time.Now()
|
||||
v.Windows[pos] = Window{
|
||||
Position: submatchall[0],
|
||||
Status: value.(string),
|
||||
@ -879,12 +877,11 @@ func (v *Vehicle) parseTirePsi(prefix, suffix, name string, value any) {
|
||||
submatchall := re.FindAllString(pos, -1)
|
||||
// v.client.logger.Debug("VEHICLE COND", "key", name, "data", value, "number", len(submatchall))
|
||||
|
||||
if tire, ok := v.Tires[pos]; ok {
|
||||
tire.PressurePsi = value.(int)
|
||||
tire.Updated = time.Now()
|
||||
if t, ok := v.Tires[pos]; ok {
|
||||
t.PressurePsi = value.(int)
|
||||
t.Updated = time.Now()
|
||||
v.Tires[pos] = t
|
||||
} else {
|
||||
tire.PressurePsi = value.(int)
|
||||
tire.Updated = time.Now()
|
||||
v.Tires[pos] = Tire{
|
||||
Position: submatchall[0],
|
||||
PressurePsi: value.(int),
|
||||
@ -907,12 +904,11 @@ func (v *Vehicle) parseTire(prefix, suffix, name string, value any) {
|
||||
submatchall := re.FindAllString(pos, -1)
|
||||
// v.client.logger.Debug("VEHICLE COND", "key", name, "data", value, "number", len(submatchall))
|
||||
|
||||
if tire, ok := v.Tires[pos]; ok {
|
||||
tire.Pressure = value.(int)
|
||||
tire.Updated = time.Now()
|
||||
if t, ok := v.Tires[pos]; ok {
|
||||
t.Pressure = value.(int)
|
||||
t.Updated = time.Now()
|
||||
v.Tires[pos] = t
|
||||
} else {
|
||||
tire.Pressure = value.(int)
|
||||
tire.Updated = time.Now()
|
||||
v.Tires[pos] = Tire{
|
||||
Position: submatchall[0],
|
||||
Pressure: value.(int),
|
||||
|
Reference in New Issue
Block a user