Prevent premature guard elapse in "charger out of sync" situation (#10340)

This commit is contained in:
MarkusGH 2023-10-17 12:44:54 +02:00 • committed by GitHub
parent 4b5e80296c
commit 8f2548e020
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -685,8 +685,8 @@ func (lp *Loadpoint) syncCharger() error {
// ignore disabled state if vehicle was disconnected ^(lp.enabled && ^lp.connected)
if lp.guardGracePeriodElapsed() && lp.phaseSwitchCompleted() && (enabled || lp.connected()) {
lp.log.WARN.Printf("charger out of sync: expected %vd, got %vd", status[lp.enabled], status[enabled])
lp.elapseGuard()
}
lp.elapseGuard()
return nil
}