Warn if vehicle detection is not possible (#3792)

This commit is contained in:
andig 2022-07-07 17:53:05 +02:00 • committed by GitHub
parent 48ba7aead6
commit db2edb9ef3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -208,6 +208,16 @@ func NewLoadPointFromConfig(log *util.Logger, cp configProvider, other map[strin
lp.vehicles = append(lp.vehicles, vehicle)
}
// verify vehicle detection
if len(lp.vehicles) > 1 {
for _, v := range lp.vehicles {
if _, ok := v.(api.ChargeState); !ok {
lp.log.WARN.Printf("vehicle '%s' does not support automatic detection", v.Title())
break
}
}
}
if lp.ChargerRef == "" {
return nil, errors.New("missing charger")
}