chore: reduce logging

This commit is contained in:
andig 2025-10-04 12:35:40 +02:00
parent c79c73a189
commit aa2eed5a47
2 changed files with 11 additions and 2 deletions

View file

@ -1792,9 +1792,11 @@ func (lp *Loadpoint) startWakeUpTimer() {
// stopWakeUpTimer stops wakeUpTimer
func (lp *Loadpoint) stopWakeUpTimer() {
if lp.wakeUpTimer.Running() {
lp.log.DEBUG.Printf("wake-up timer: stop")
lp.wakeUpTimer.Stop()
}
}
func (lp *Loadpoint) shouldBeConsistent() bool {
return lp.chargerUpdateCompleted() && lp.phaseSwitchCompleted()

View file

@ -57,6 +57,13 @@ func (m *Timer) Stop() {
m.started = time.Time{}
}
func (m *Timer) Running() bool {
m.Lock()
defer m.Unlock()
return !m.started.IsZero()
}
// Elapsed checks if the timer has elapsed and if resets its status
func (m *Timer) Elapsed() WakeUpEvent {
m.Lock()