Reset status reason when charging or disconnecting (#15909)
This commit is contained in:
parent
9ca0bd4858
commit
1c19de612a
1 changed files with 7 additions and 1 deletions
|
|
@ -427,6 +427,9 @@ func (lp *Loadpoint) evChargeStartHandler() {
|
|||
lp.log.INFO.Println("start charging ->")
|
||||
lp.pushEvent(evChargeStart)
|
||||
|
||||
// charge status
|
||||
lp.publish(keys.ChargerStatusReason, api.ReasonUnknown)
|
||||
|
||||
lp.stopWakeUpTimer()
|
||||
|
||||
// soc update reset
|
||||
|
|
@ -509,6 +512,9 @@ func (lp *Loadpoint) evVehicleDisconnectHandler() {
|
|||
lp.publish(keys.ChargedEnergy, lp.getChargedEnergy())
|
||||
lp.publish(keys.ConnectedDuration, lp.clock.Since(lp.connectedTime).Round(time.Second))
|
||||
|
||||
// charge status
|
||||
lp.publish(keys.ChargerStatusReason, api.ReasonUnknown)
|
||||
|
||||
// forget startup energy offset
|
||||
lp.chargedAtStartup = 0
|
||||
|
||||
|
|
@ -1674,7 +1680,7 @@ func (lp *Loadpoint) Update(sitePower float64, rates api.Rates, batteryBuffered,
|
|||
lp.publish(keys.Connected, lp.connected())
|
||||
lp.publish(keys.Charging, lp.charging())
|
||||
|
||||
if sr, ok := lp.charger.(api.StatusReasoner); ok {
|
||||
if sr, ok := lp.charger.(api.StatusReasoner); ok && lp.GetStatus() == api.StatusB {
|
||||
if r, err := sr.StatusReason(); err == nil {
|
||||
lp.publish(keys.ChargerStatusReason, r)
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue