velky refaktor - sladeni planovani LP aby pocital s realnym max sell/buy co pusti stridac
Some checks failed
CI and deploy / migration-check (push) Failing after 21s
CI and deploy / deploy (push) Has been skipped

This commit is contained in:
Dusan Vojacek
2026-05-23 21:54:23 +02:00
parent b44f74b249
commit e3e5fc138c
7 changed files with 201 additions and 46 deletions

View File

@@ -1784,8 +1784,10 @@ class Home01RegressionTests(unittest.TestCase):
charged_slots = sum(1 for r in results[:peak_idx] if r.battery_setpoint_w > 500 or r.grid_setpoint_w > 500)
self.assertGreater(charged_slots, 2, "levné sloty mají nabíjet ze sítě nebo PV")
evening = results[peak_idx]
self.assertLess(evening.grid_setpoint_w, -5_000)
self.assertEqual(evening.export_mode, "BATTERY_SELL")
total_export_w = max(0, -evening.grid_setpoint_w) + max(0, -evening.battery_setpoint_w)
self.assertGreater(total_export_w, 2_000, "večerní peak: výrazný export z baterie/sítě")
if evening.grid_setpoint_w < 0:
self.assertEqual(evening.export_mode, "BATTERY_SELL")
inputs = snap.get("inputs") or {}
self.assertTrue(inputs.get("two_pass_enabled"))