Always publish status
This commit is contained in:
parent
06c17c33ae
commit
1d34e01e8c
1 changed files with 5 additions and 6 deletions
|
|
@ -637,17 +637,16 @@ func (lp *Loadpoint) syncCharger() error {
|
|||
return err
|
||||
}
|
||||
|
||||
// in sync
|
||||
if enabled == lp.enabled {
|
||||
return nil
|
||||
}
|
||||
|
||||
// out of sync
|
||||
defer func() {
|
||||
lp.enabled = enabled
|
||||
lp.publish("enabled", lp.enabled)
|
||||
}()
|
||||
|
||||
// in sync
|
||||
if enabled == lp.enabled {
|
||||
return nil
|
||||
}
|
||||
|
||||
if enabled || lp.phaseSwitchCommandTimeoutElapsed() {
|
||||
// ignore disabled state if vehicle was disconnected ^(lp.enabled && ^lp.connected)
|
||||
if lp.guardGracePeriodElapsed() && lp.phaseSwitchCompleted() && (enabled || lp.connected()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue