Volvo Connected: verify vehicle identity against account (#31089)

This commit is contained in:
andig 2026-06-21 13:05:50 +02:00 • committed by GitHub
parent 9d65083ae7
commit 6cd76d78bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 8 deletions

View file

@ -41,10 +41,6 @@ func NewVolvoConnectedFromConfig(ctx context.Context, other map[string]any) (api
return nil, errors.New("missing vccapikey")
}
if cc.VIN == "" {
return nil, errors.New("missing vin")
}
if err := cc.Credentials.Error(); err != nil {
return nil, err
}
@ -59,10 +55,15 @@ func NewVolvoConnectedFromConfig(ctx context.Context, other map[string]any) (api
api := connected.NewAPI(log, cc.VccApiKey, ts)
cc.VIN, err = ensureVehicle(cc.VIN, api.Vehicles)
v := &VolvoConnected{
embed: &cc.embed,
Provider: connected.NewProvider(api, ts, cc.VIN, cc.Cache),
embed: &cc.embed,
}
return v, nil
if err == nil {
v.Provider = connected.NewProvider(api, ts, cc.VIN, cc.Cache)
}
return v, err
}