Validate currents

This commit is contained in:
andig 2021-06-21 12:08:42 +02:00
parent 3a467f8492
commit 92b2c36108

View file

@ -169,6 +169,14 @@ func NewLoadPointFromConfig(log *util.Logger, cp configProvider, other map[strin
}
}
if lp.MinCurrent == 0 {
log.WARN.Println("minCurrent must not be zero")
}
if lp.MaxCurrent <= lp.MinCurrent {
log.WARN.Println("maxCurrent must be larger than minCurrent")
}
if lp.Meters.ChargeMeterRef != "" {
lp.chargeMeter = cp.Meter(lp.Meters.ChargeMeterRef)
}