Fixed an issues with the windows and tires
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:
16
vehicle.go
16
vehicle.go
@ -634,13 +634,13 @@ func (v *Vehicle) GetVehicleStatus() {
|
||||
submatchall := re.FindAllString(pos, -1)
|
||||
v.client.logger.Debug("VEHICLE COND", "key", key, "data", child.Data(), "number", len(submatchall))
|
||||
|
||||
if window, ok := v.Windows[submatchall[0]+submatchall[1]]; ok {
|
||||
if window, ok := v.Windows[pos]; ok {
|
||||
window.Status = child.Data().(string)
|
||||
window.Updated = time.Now()
|
||||
} else {
|
||||
window.Status = child.Data().(string)
|
||||
window.Updated = time.Now()
|
||||
v.Windows[submatchall[0]+submatchall[1]] = Window{
|
||||
v.Windows[pos] = Window{
|
||||
Position: submatchall[0],
|
||||
Status: child.Data().(string),
|
||||
Updated: time.Now(),
|
||||
@ -659,13 +659,13 @@ func (v *Vehicle) GetVehicleStatus() {
|
||||
submatchall := re.FindAllString(pos, -1)
|
||||
v.client.logger.Debug("VEHICLE COND", "key", key, "data", child.Data(), "number", len(submatchall))
|
||||
|
||||
if tire, ok := v.Tires[submatchall[0]+submatchall[1]]; ok {
|
||||
if tire, ok := v.Tires[pos]; ok {
|
||||
tire.PressurePsi = child.Data().(int)
|
||||
tire.Updated = time.Now()
|
||||
} else {
|
||||
tire.PressurePsi = child.Data().(int)
|
||||
tire.Updated = time.Now()
|
||||
v.Tires[submatchall[0]+submatchall[1]] = Tire{
|
||||
v.Tires[pos] = Tire{
|
||||
Position: submatchall[0],
|
||||
PressurePsi: child.Data().(int),
|
||||
Updated: time.Now(),
|
||||
@ -806,13 +806,13 @@ func (v *Vehicle) GetVehicleCondition() {
|
||||
submatchall := re.FindAllString(pos, -1)
|
||||
v.client.logger.Debug("VEHICLE COND", "key", key, "data", child.Data(), "number", len(submatchall))
|
||||
|
||||
if window, ok := v.Windows[submatchall[0]+submatchall[1]]; ok {
|
||||
if window, ok := v.Windows[pos]; ok {
|
||||
window.Status = child.Data().(string)
|
||||
window.Updated = time.Now()
|
||||
} else {
|
||||
window.Status = child.Data().(string)
|
||||
window.Updated = time.Now()
|
||||
v.Windows[submatchall[0]+submatchall[1]] = Window{
|
||||
v.Windows[pos] = Window{
|
||||
Position: submatchall[0],
|
||||
Status: child.Data().(string),
|
||||
Updated: time.Now(),
|
||||
@ -831,13 +831,13 @@ func (v *Vehicle) GetVehicleCondition() {
|
||||
submatchall := re.FindAllString(pos, -1)
|
||||
v.client.logger.Debug("VEHICLE COND", "key", key, "data", child.Data(), "number", len(submatchall))
|
||||
|
||||
if tire, ok := v.Tires[submatchall[0]+submatchall[1]]; ok {
|
||||
if tire, ok := v.Tires[pos]; ok {
|
||||
tire.PressurePsi = child.Data().(int)
|
||||
tire.Updated = time.Now()
|
||||
} else {
|
||||
tire.PressurePsi = child.Data().(int)
|
||||
tire.Updated = time.Now()
|
||||
v.Tires[submatchall[0]+submatchall[1]] = Tire{
|
||||
v.Tires[pos] = Tire{
|
||||
Position: submatchall[0],
|
||||
PressurePsi: child.Data().(int),
|
||||
Updated: time.Now(),
|
||||
|
Reference in New Issue
Block a user