From 4828d197d67e6c2a2df4ceba929f27cbf45dc4ab Mon Sep 17 00:00:00 2001 From: andig Date: Mon, 10 May 2021 21:57:29 +0200 Subject: [PATCH] VW: respect home region --- internal/vehicle/vw.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/vehicle/vw.go b/internal/vehicle/vw.go index ffc43cdf8..31999afef 100644 --- a/internal/vehicle/vw.go +++ b/internal/vehicle/vw.go @@ -66,7 +66,11 @@ func NewVWFromConfig(other map[string]interface{}) (api.Vehicle, error) { } } - v.Provider = vw.NewProvider(api, strings.ToUpper(cc.VIN), cc.Cache) + if err == nil { + if err = api.HomeRegion(strings.ToUpper(cc.VIN)); err == nil { + v.Provider = vw.NewProvider(api, strings.ToUpper(cc.VIN), cc.Cache) + } + } return v, err }