summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2022-10-19 05:19:48 +0300
committerEvgeny Zinoviev <me@ch1p.io>2022-10-19 05:19:48 +0300
commitaf66b95240f8315c210bf3647b3ad303775be0d1 (patch)
tree7c361f991fc68daf4093d2d494fe884679c3abf4
parent2a3dafb2cb96bd35dcf240a336c5dbe9de963f66 (diff)
inverter/monitor: logic fix
-rw-r--r--src/home/inverter/monitor.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/home/inverter/monitor.py b/src/home/inverter/monitor.py
index f00a65f..a950c52 100644
--- a/src/home/inverter/monitor.py
+++ b/src/home/inverter/monitor.py
@@ -175,6 +175,7 @@ class InverterMonitor(Thread):
if self.ac_mode == ACMode.GENERATOR:
self.gen_charging_program(ac, solar, v, pd)
+
elif self.ac_mode == ACMode.UTILITIES:
self.utilities_monitoring_program(ac, solar, pd)
@@ -208,12 +209,12 @@ class InverterMonitor(Thread):
self.util_ac_present = ac
if self.util_pd is None or self.util_pd != pd:
+ self.util_pd = pd
if not pd_event_send:
if pd == BatteryPowerDirection.CHARGING:
self.charging_event_handler(ChargingEvent.UTIL_CHARGING_STARTED)
else:
self.charging_event_handler(ChargingEvent.UTIL_CHARGING_STOPPED)
- self.util_pd = pd
def gen_charging_program(self,
ac: bool, # whether AC is connected