From 55fa7c6a9d0673ad6fb43dce5c19d58642125932 Mon Sep 17 00:00:00 2001 From: Paul Warren Date: Tue, 5 Nov 2024 17:56:04 +1100 Subject: [PATCH] start of abstraction layer added --- src/pyfronius/gen24.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/pyfronius/gen24.py diff --git a/src/pyfronius/gen24.py b/src/pyfronius/gen24.py new file mode 100644 index 0000000..4a34c68 --- /dev/null +++ b/src/pyfronius/gen24.py @@ -0,0 +1,32 @@ +# This attempts to be a simpler interface to a Fronius Gen24 Primo/Symo +# Inverter. With some functions to poll status and set various parameters +# easily without needing to know the underlyin modbus registers. +# + + +class Gen24: + def __init__(self, modbus_client): + self._modbus_client = modbus_client + + def status(self): + pass + # return dict with: + # solar power + # AC power + # inverter status + + +class Gen24Storage(Gen24): + def __init__(self, modbus_client): + super().__init__(modbus_client) + + def status(self) -> {}: + base_stats = super().stats(self) + extra_stats = self._getStorageStats() + return base_stats.append(extra_stats) + + def forceStorageCharge(self, watts=2500, time="1 hour"): + pass + + def _getStorageStats(): + pass