fix rizeni pole pres reg340 jen home01
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-02 09:31:45 +02:00
parent ed88ef8910
commit fffe6c7185
9 changed files with 86 additions and 42 deletions

View File

@@ -53,12 +53,12 @@ class ComputePvAReg340Tests(unittest.TestCase):
class BuildSetpointsReg340Tests(unittest.TestCase):
def test_deye_with_cap_sets_pv_a_allowed(self) -> None:
def test_with_cap_sets_pv_a_allowed(self) -> None:
sp = _build_setpoints(
_auto_mode(),
_pi_base(pv_a_forecast_solver_w=8000, pv_a_curtailed_w=2000),
pv_a_cap_w=10_000,
inverter_manufacturer="Deye",
reg340_pv_a_control_enabled=True,
)
assert sp is not None
self.assertEqual(sp.pv_a_allowed_w, 6000)
@@ -68,17 +68,7 @@ class BuildSetpointsReg340Tests(unittest.TestCase):
_auto_mode(),
_pi_base(),
pv_a_cap_w=0,
inverter_manufacturer="Deye",
)
assert sp is not None
self.assertIsNone(sp.pv_a_allowed_w)
def test_skipped_for_non_deye(self) -> None:
sp = _build_setpoints(
_auto_mode(),
_pi_base(),
pv_a_cap_w=10_000,
inverter_manufacturer="Foo",
reg340_pv_a_control_enabled=True,
)
assert sp is not None
self.assertIsNone(sp.pv_a_allowed_w)
@@ -92,9 +82,7 @@ class BuildSetpointsReg340Tests(unittest.TestCase):
heat_pump_enabled_def=False,
loxone_mode_value=0,
)
sp = _build_setpoints(
mode, None, pv_a_cap_w=10_000, inverter_manufacturer="Deye"
)
sp = _build_setpoints(mode, None, pv_a_cap_w=10_000)
assert sp is not None
self.assertIsNone(sp.pv_a_allowed_w)
@@ -109,11 +97,21 @@ class BuildSetpointsReg340Tests(unittest.TestCase):
pv_a_curtailed_w=0,
),
pv_a_cap_w=3333,
inverter_manufacturer="Deye",
reg340_pv_a_control_enabled=True,
)
assert sp is not None
self.assertEqual(sp.pv_a_allowed_w, 0)
def test_skipped_when_reg340_control_disabled(self) -> None:
sp = _build_setpoints(
_auto_mode(),
_pi_base(pv_a_forecast_solver_w=8000, pv_a_curtailed_w=2000),
pv_a_cap_w=10_000,
reg340_pv_a_control_enabled=False,
)
assert sp is not None
self.assertIsNone(sp.pv_a_allowed_w)
class Reg340VerifyPolicyTests(unittest.TestCase):
def test_reg340_not_critical_for_self_sustain(self) -> None: