summaryrefslogtreecommitdiff
path: root/src/home
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2022-09-02 13:37:49 +0300
committerEvgeny Zinoviev <me@ch1p.io>2022-09-02 13:38:02 +0300
commitc7e10c52a9cd5be57e86e4e911bd21d6380771a6 (patch)
treee1115e551d9fdb64048fa7ba1a2561d96c7eadb8 /src/home
parent06ca251b94e06b8fe58437704a7ada716d3056b0 (diff)
inverter: support inverter-tools 1.5.0
Diffstat (limited to 'src/home')
-rw-r--r--src/home/database/inverter.py8
-rw-r--r--src/home/inverter/monitor.py6
-rw-r--r--src/home/mqtt/message/inverter.py8
3 files changed, 11 insertions, 11 deletions
diff --git a/src/home/database/inverter.py b/src/home/database/inverter.py
index 8902f04..6fdf9d7 100644
--- a/src/home/database/inverter.py
+++ b/src/home/database/inverter.py
@@ -24,8 +24,8 @@ class InverterDatabase:
battery_voltage: int,
battery_voltage_scc: int,
battery_voltage_scc2: int,
- battery_discharging_current: int,
- battery_charging_current: int,
+ battery_discharge_current: int,
+ battery_charge_current: int,
battery_capacity: int,
inverter_heat_sink_temp: int,
mppt1_charger_temp: int,
@@ -83,8 +83,8 @@ class InverterDatabase:
battery_voltage,
battery_voltage_scc,
battery_voltage_scc2,
- battery_discharging_current,
- battery_charging_current,
+ battery_discharge_current,
+ battery_charge_current,
battery_capacity,
inverter_heat_sink_temp,
mppt1_charger_temp,
diff --git a/src/home/inverter/monitor.py b/src/home/inverter/monitor.py
index 444d3bc..87e07be 100644
--- a/src/home/inverter/monitor.py
+++ b/src/home/inverter/monitor.py
@@ -131,7 +131,7 @@ class InverterMonitor(Thread):
def run(self):
# Check allowed currents and validate the config.
- allowed_currents = list(inverter.exec('get-allowed-ac-charging-currents')['data'])
+ allowed_currents = list(inverter.exec('get-allowed-ac-charge-currents')['data'])
allowed_currents.sort()
for a in self.currents:
@@ -397,10 +397,10 @@ class InverterMonitor(Thread):
def set_hw_charging_current(self, current: int):
try:
- response = inverter.exec('set-max-ac-charging-current', (0, current))
+ response = inverter.exec('set-max-ac-charge-current', (0, current))
if response['result'] != 'ok':
logger.error(f'failed to change AC charging current to {current} A')
- raise InverterError('set-max-ac-charging-current: inverterd reported error')
+ raise InverterError('set-max-ac-charge-current: inverterd reported error')
else:
self.charging_event_handler(ChargingEvent.AC_CURRENT_CHANGED, current=current)
logger.info(f'changed AC charging current to {current} A')
diff --git a/src/home/mqtt/message/inverter.py b/src/home/mqtt/message/inverter.py
index 2df17e5..d36aad5 100644
--- a/src/home/mqtt/message/inverter.py
+++ b/src/home/mqtt/message/inverter.py
@@ -29,8 +29,8 @@ class Status:
int(data['battery_voltage'] * 10),
int(data['battery_voltage_scc'] * 10),
int(data['battery_voltage_scc2'] * 10),
- data['battery_discharging_current'],
- data['battery_charging_current'],
+ data['battery_discharge_current'],
+ data['battery_charge_current'],
data['battery_capacity'],
data['inverter_heat_sink_temp'],
data['mppt1_charger_temp'],
@@ -55,8 +55,8 @@ class Status:
'battery_voltage': data[8] / 10,
'battery_voltage_scc': data[9] / 10,
'battery_voltage_scc2': data[10] / 10,
- 'battery_discharging_current': data[11],
- 'battery_charging_current': data[12],
+ 'battery_discharge_current': data[11],
+ 'battery_charge_current': data[12],
'battery_capacity': data[13],
'inverter_heat_sink_temp': data[14],
'mppt1_charger_temp': data[15],