fix chargedischarge A
Some checks failed
CI and deploy / migration-check (pull_request) Failing after 25s
CI and deploy / deploy (pull_request) Has been skipped

This commit is contained in:
Dusan Vojacek
2026-05-04 19:37:42 +02:00
parent 6471467bc5
commit b35f292295
4 changed files with 26 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
"""PASSIVE + nabíjení z PV přebytku při současném exportu → nenulový nabíjecí proud."""
"""PASSIVE + plán chce nabíjet: 108 = plný strop z DB, 109 = max (PV špička + domácnost)."""
from __future__ import annotations
@@ -18,6 +18,21 @@ class PassivePvSurplusChargeAmpsTests(unittest.TestCase):
max_charge_a=100,
max_discharge_a=100,
)
self.assertEqual(ch, 100)
self.assertEqual(dis, 100)
def test_charge_mode_still_scales_108_from_battery_w(self) -> None:
"""CHARGE (síť + baterie): 108 podle plánu, ne vždy plný strop."""
ch, dis = deye_battery_charge_discharge_amps(
lock_battery=False,
deye_mode="CHARGE",
self_sustain_local_use=False,
bat_w=2000,
grid_w=3000,
max_charge_a=100,
max_discharge_a=100,
)
self.assertLess(ch, 100)
self.assertGreater(ch, 0)
self.assertEqual(dis, 0)