Skip to content

Commit

Permalink
Loadpoint: warm only if current delta >= 1
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Oct 2, 2024
1 parent c07a235 commit d020759
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/loadpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -723,8 +723,8 @@ func (lp *Loadpoint) syncCharger() error {
if isCg {
if current, err = cg.GetMaxCurrent(); err == nil {
// smallest adjustment most PWM-Controllers can do is: 100%÷256×0,6A = 0.234A
if math.Abs(lp.chargeCurrent-current) > 0.23 {
if shouldBeConsistent {
if delta := math.Abs(lp.chargeCurrent - current); delta > 0.23 {
if shouldBeConsistent && delta >= 1 {
lp.log.WARN.Printf("charger logic error: current mismatch (got %.3gA, expected %.3gA)", current, lp.chargeCurrent)
}
lp.chargeCurrent = current
Expand Down

0 comments on commit d020759

Please sign in to comment.