-- 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.';
