Skip to content

Commit

Permalink
Mercedes: fix HTTP 502 when VIN is present and not equal FIN (#12535)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReneNulschDE authored Feb 28, 2024
1 parent 3f457e7 commit 9001258
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vehicle/mercedes/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ func (v *API) Vehicles() ([]string, error) {

var vehicles []string
for _, v := range res.AssignedVehicles {
vehicles = append(vehicles, v.Fin)
if len(v.Vin) > 0 {
vehicles = append(vehicles, v.Vin)
} else {
vehicles = append(vehicles, v.Fin)
}
}

return vehicles, err
Expand Down
1 change: 1 addition & 0 deletions vehicle/mercedes/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type VehiclesResponse struct {

type Vehicle struct {
Fin string
Vin string
}

type StatusResponse struct {
Expand Down

0 comments on commit 9001258

Please sign in to comment.