narovnani spravneho rezimu - nastavenim charge A
Some checks failed
CI and deploy / migration-check (push) Failing after 12s
CI and deploy / deploy (push) Has been skipped

This commit is contained in:
Dusan Vojacek
2026-05-21 10:23:53 +02:00
parent 44a06b6288
commit eb425a26f2
8 changed files with 95 additions and 92 deletions

View File

@@ -17,7 +17,6 @@ from services.control.exporter_monolith import (
from services.control.models import OperatingModeInfo
from services.control.setpoints import (
_build_setpoints,
_deye_reg142_limit_control,
_deye_zero_export_amps_for_passive,
)
@@ -115,43 +114,6 @@ class DeyeTouParamsTests(unittest.TestCase):
)
self.assertEqual(get_deye_mode(sp), "PASSIVE")
def test_reg142_pv_surplus_on_ct_site_uses_selling_first(self) -> None:
"""KV1/BA81: PASSIVE + plánovaný export FVE nesmí nechat reg142=2 (zero export CT)."""
self.assertEqual(
_deye_reg142_limit_control(
deye_mode="PASSIVE",
grid_w=-3000,
export_ban=False,
export_mode="PV_SURPLUS",
zero_export_mode=2,
),
0,
)
def test_reg142_no_export_when_export_ban(self) -> None:
self.assertEqual(
_deye_reg142_limit_control(
deye_mode="PASSIVE",
grid_w=-1000,
export_ban=True,
export_mode="PV_SURPLUS",
zero_export_mode=2,
),
2,
)
def test_reg142_legacy_negative_grid_without_export_mode(self) -> None:
self.assertEqual(
_deye_reg142_limit_control(
deye_mode="PASSIVE",
grid_w=-2500,
export_ban=False,
export_mode=None,
zero_export_mode=2,
),
0,
)
def test_build_setpoints_uses_explicit_export_limit(self) -> None:
mode = OperatingModeInfo(
mode_code="AUTO",