Loadpoint: reset fake charge time when interrupting session (#22396)
This commit is contained in:
parent
6a7b86707f
commit
74b1fa561c
2 changed files with 13 additions and 0 deletions
|
|
@ -48,6 +48,16 @@ func (m *ChargeTimer) StopCharge() {
|
|||
m.duration += m.clck.Since(m.start)
|
||||
}
|
||||
|
||||
var _ ChargeResetter = (*ChargeTimer)(nil)
|
||||
|
||||
// ChargeResetter resets the charging session
|
||||
func (m *ChargeTimer) ResetCharge() {
|
||||
m.Lock()
|
||||
defer m.Unlock()
|
||||
|
||||
m.duration = 0
|
||||
}
|
||||
|
||||
// ChargeDuration implements the api.ChargeTimer interface
|
||||
func (m *ChargeTimer) ChargeDuration() (time.Duration, error) {
|
||||
m.Lock()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue