summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2022-10-22 19:33:40 +0300
committerEvgeny Zinoviev <me@ch1p.io>2022-10-22 19:33:40 +0300
commit1b8237280d10f4ed19facceb5441243471536e5f (patch)
tree29c7b15b3812fc3e609e9e3f0b2f0c77ec3c3cf5 /src
parentff73c73a2cc9764dba3dbcabce68eca3b028b03c (diff)
inverter: improve util program
Diffstat (limited to 'src')
-rw-r--r--src/home/inverter/monitor.py4
-rwxr-xr-xsrc/inverter_bot.py1
2 files changed, 5 insertions, 0 deletions
diff --git a/src/home/inverter/monitor.py b/src/home/inverter/monitor.py
index 898c998..f661d73 100644
--- a/src/home/inverter/monitor.py
+++ b/src/home/inverter/monitor.py
@@ -474,6 +474,9 @@ class InverterMonitor(Thread):
def set_ac_mode(self, mode: ACMode):
self.ac_mode = mode
+ def notify_osp(self, osp: OutputSourcePriority):
+ self.osp = osp
+
def stop(self):
self.interrupted = True
@@ -491,6 +494,7 @@ class InverterMonitor(Thread):
'time_now': time.time(),
'next_current_enter_time': self.next_current_enter_time,
'ac_mode': self.ac_mode,
+ 'osp': self.osp,
'util_ac_present': self.util_ac_present,
'util_pd': self.util_pd.name,
'util_solar': self.util_solar
diff --git a/src/inverter_bot.py b/src/inverter_bot.py
index 7d142e7..223c7b3 100755
--- a/src/inverter_bot.py
+++ b/src/inverter_bot.py
@@ -302,6 +302,7 @@ def setacmode(mode: ACMode):
def setosp(sp: OutputSourcePriority):
logger.debug(f'setosp: sp={sp}')
inverter.exec('set-output-source-priority', (sp.value,))
+ monitor.notify_osp(sp)
# /setacmode