Skip to content

Commit

Permalink
Warn if vehicle detection is not possible (#3792)
Browse files Browse the repository at this point in the history
  • Loading branch information
andig authored Jul 7, 2022
1 parent 48ba7ae commit db2edb9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions core/loadpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit db2edb9

Please sign in to comment.