Ensure upper-case VINs
This commit is contained in:
parent
d136456e41
commit
fb99917cb6
5 changed files with 6 additions and 5 deletions
|
|
@ -97,7 +97,7 @@ func NewAudiFromConfig(other map[string]interface{}) (api.Vehicle, error) {
|
|||
Helper: request.NewHelper(log),
|
||||
user: cc.User,
|
||||
password: cc.Password,
|
||||
vin: cc.VIN,
|
||||
vin: strings.ToUpper(cc.VIN),
|
||||
brand: "Audi",
|
||||
country: "DE",
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ func NewBMWFromConfig(other map[string]interface{}) (api.Vehicle, error) {
|
|||
Helper: request.NewHelper(log),
|
||||
user: cc.User,
|
||||
password: cc.Password,
|
||||
vin: cc.VIN,
|
||||
vin: strings.ToUpper(cc.VIN),
|
||||
}
|
||||
|
||||
v.chargeStateG = provider.NewCached(v.chargeState, cc.Cache).FloatGetter()
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ func NewPorscheFromConfig(other map[string]interface{}) (api.Vehicle, error) {
|
|||
Helper: request.NewHelper(util.NewLogger("porsche")),
|
||||
user: cc.User,
|
||||
password: cc.Password,
|
||||
vin: cc.VIN,
|
||||
vin: strings.ToUpper(cc.VIN),
|
||||
}
|
||||
|
||||
v.chargeStateG = provider.NewCached(v.chargeState, cc.Cache).FloatGetter()
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ func NewRenaultFromConfig(other map[string]interface{}) (api.Vehicle, error) {
|
|||
Helper: request.NewHelper(log),
|
||||
user: cc.User,
|
||||
password: cc.Password,
|
||||
vin: cc.VIN,
|
||||
vin: strings.ToUpper(cc.VIN),
|
||||
}
|
||||
|
||||
err := v.apiKeys(cc.Region)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package vehicle
|
|||
import (
|
||||
"errors"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/andig/evcc/api"
|
||||
|
|
@ -66,7 +67,7 @@ func NewTeslaFromConfig(other map[string]interface{}) (api.Vehicle, error) {
|
|||
v.vehicle = vehicles[0].Vehicle
|
||||
} else {
|
||||
for _, vehicle := range vehicles {
|
||||
if vehicle.Vin == cc.VIN {
|
||||
if vehicle.Vin == strings.ToUpper(cc.VIN) {
|
||||
v.vehicle = vehicle.Vehicle
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue