Add support for inverter current caps in site configuration
Some checks failed
deploy / deploy (push) Failing after 55s
test / smoke-test (push) Successful in 3s

- Introduced `InverterModbusCurrentCapsBody` model for updating max charge and discharge currents.
- Updated SQL queries to utilize `COALESCE` for effective current limits.
- Modified relevant tests to reflect changes in battery current handling.
- Added new SQL migration for `deye_register_max_current_a` columns in the database.
This commit is contained in:
Dusan Vojacek
2026-04-19 12:10:37 +02:00
parent fd06811753
commit a1aa6acf61
7 changed files with 121 additions and 56 deletions

View File

@@ -4,6 +4,6 @@ ALTER TABLE ems.asset_inverter
ADD COLUMN IF NOT EXISTS deye_register_max_discharge_a INT NULL;
COMMENT ON COLUMN ems.asset_inverter.deye_register_max_charge_a IS
'Optional cap for holding reg 108 (A); NULL = use only LEAST(W)/51.2 derived max.';
'Optional A for reg 108; EMS uses COALESCE(this, FLOOR(LEAST(W)/51.2)) in _load_inverter_config.';
COMMENT ON COLUMN ems.asset_inverter.deye_register_max_discharge_a IS
'Optional cap for holding reg 109 (A); NULL = use only derived max.';
'Optional A for reg 109; EMS uses COALESCE(this, FLOOR(LEAST(W)/51.2)) in _load_inverter_config.';