Files
ems/db/migration/V044__deye_register_max_current_a.sql
Dusan Vojacek a1aa6acf61
Some checks failed
deploy / deploy (push) Failing after 55s
test / smoke-test (push) Successful in 3s
Add support for inverter current caps in site configuration
- 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.
2026-04-19 12:10:37 +02:00

10 lines
644 B
SQL

-- Volitelný tvrdý strop proudu pro Modbus reg 108/109 (Deye může firmwarem oříznout pod W-odvozeným max, např. 351→350 A).
ALTER TABLE ems.asset_inverter
ADD COLUMN IF NOT EXISTS deye_register_max_charge_a INT NULL,
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 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 A for reg 109; EMS uses COALESCE(this, FLOOR(LEAST(W)/51.2)) in _load_inverter_config.';