Update power and currents after charger update to improve UI responsiveness
This commit is contained in:
parent
53bb654848
commit
ad0211e9c6
1 changed files with 7 additions and 1 deletions
|
|
@ -33,6 +33,7 @@ const (
|
|||
minActiveCurrent = 1.0 // minimum current at which a phase is treated as active
|
||||
vehicleDetectInterval = 3 * time.Minute
|
||||
vehicleDetectDuration = 10 * time.Minute
|
||||
settleDuration = 100 * time.Millisecond
|
||||
)
|
||||
|
||||
// PollConfig defines the vehicle polling mode and interval
|
||||
|
|
@ -1334,7 +1335,12 @@ func (lp *LoadPoint) Update(sitePower float64, cheap bool, batteryBuffered bool)
|
|||
lp.publish("remoteDisabled", remoteDisabled)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
// read and publish meters after settings are applied
|
||||
if err == nil {
|
||||
time.Sleep(settleDuration)
|
||||
lp.updateChargePower()
|
||||
lp.updateChargeCurrents()
|
||||
} else {
|
||||
lp.log.ERROR.Println(err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue