nastavitelny max sollar dle stridace (ulozeno v DB)
Some checks failed
CI and deploy / migration-check (push) Failing after 13s
CI and deploy / deploy (push) Has been skipped

This commit is contained in:
Dusan Vojacek
2026-05-25 11:25:29 +02:00
parent e06f76b9ff
commit c6074e9c74
13 changed files with 101 additions and 17 deletions

View File

@@ -38,6 +38,7 @@ async def export_setpoints(site_id: int, db: asyncpg.Connection) -> None:
try:
inv_for_pv = await _load_inverter_config(site_id, db)
cap_pv = int(inv_for_pv.pv_a_cap_w) if inv_for_pv is not None else 0
min_pv = int(inv_for_pv.pv_a_reg340_min_w) if inv_for_pv is not None else 0
reg340_en = (
bool(inv_for_pv.deye_reg340_pv_a_control_enabled)
if inv_for_pv is not None
@@ -49,12 +50,14 @@ async def export_setpoints(site_id: int, db: asyncpg.Connection) -> None:
mode,
pi_now,
pv_a_cap_w=cap_pv,
pv_a_reg340_min_w=min_pv,
reg340_pv_a_control_enabled=reg340_en,
)
sp_next = _build_setpoints(
mode,
pi_next,
pv_a_cap_w=cap_pv,
pv_a_reg340_min_w=min_pv,
reg340_pv_a_control_enabled=reg340_en,
)