summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2022-08-21 22:10:13 +0300
committerEvgeny Zinoviev <me@ch1p.io>2022-08-21 22:10:13 +0300
commite636419bd2598d9a3cfccfba21b07db68c0f53fd (patch)
treedd0c0115589d396907c18de45962cfc8d681404f /src
parent43895519a718810fc0ac0defd76047e0fd6229d9 (diff)
inverter/monitor: gen_stop(): always reset state
Diffstat (limited to 'src')
-rw-r--r--src/home/inverter/monitor.py11
1 files changed, 5 insertions, 6 deletions
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: