Adjust target current based on current target instead of measured value (#1431)

This commit is contained in:
andig 2021-08-27 15:56:37 +02:00 • committed by GitHub
parent 61a00566d3
commit 0abf756b0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -797,11 +797,11 @@ func (lp *LoadPoint) updateChargerStatus() error {
}
// effectiveCurrent returns the currently effective charging current
// it does not take measured currents into account
func (lp *LoadPoint) effectiveCurrent() float64 {
// use measured L1 current
// adjust actual current for vehicles like Zoe where it remains below target
if lp.chargeCurrents != nil {
return lp.chargeCurrents[0]
cur := lp.chargeCurrents[0]
return math.Min(cur+2.0, lp.chargeCurrent)
}
if lp.GetStatus() != api.StatusC {