From e636419bd2598d9a3cfccfba21b07db68c0f53fd Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Sun, 21 Aug 2022 22:10:13 +0300 Subject: inverter/monitor: gen_stop(): always reset state --- src/home/inverter/monitor.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/home/inverter/monitor.py') diff --git a/src/home/inverter/monitor.py b/src/home/inverter/monitor.py index daa7d0c..952b8c8 100644 --- a/src/home/inverter/monitor.py +++ b/src/home/inverter/monitor.py @@ -349,12 +349,11 @@ class InverterMonitor(Thread): logger.info(f'charging is finished, entering {reason} state') self.charging_event_handler(event) - # Let Mr. Proper do his job - if self.active_current_idx != -1: - self.next_current_enter_time = 0 - self.mostly_charged = False - self.active_current_idx = -1 - self.floating_stopwatch.reset() + self.next_current_enter_time = 0 + self.mostly_charged = False + self.active_current_idx = -1 + self.floating_stopwatch.reset() + self.current_change_direction = CurrentChangeDirection.UP def gen_next_current(self, current=None): if current is None: -- cgit v1.2.3