dalsi snaha o fix
This commit is contained in:
@@ -1285,6 +1285,47 @@ class AutoPassiveSelfConsumptionTests(unittest.TestCase):
|
||||
)
|
||||
self.assertEqual(len(results), 20)
|
||||
|
||||
def test_spot_low_acquisition_does_not_mark_all_slots_expensive(self) -> None:
|
||||
"""Spot + charge_acquisition ~0,9 nesmí z buy>acq udělat gi=0 pro dům ve všech slotech."""
|
||||
base = datetime(2026, 5, 22, 10, 0, tzinfo=timezone.utc)
|
||||
slots = [
|
||||
PlanningSlot(
|
||||
interval_start=base + timedelta(minutes=15 * i),
|
||||
buy_price=2.5 + 0.1 * i,
|
||||
sell_price=3.0,
|
||||
pv_a_forecast_w=2000,
|
||||
pv_b_forecast_w=3000,
|
||||
load_baseline_w=2000,
|
||||
ev1_connected=False,
|
||||
ev2_connected=False,
|
||||
allow_charge=False,
|
||||
allow_discharge_export=False,
|
||||
charge_acquisition_buy_czk_kwh=0.94,
|
||||
future_sell_opportunity_czk_kwh=5.5,
|
||||
)
|
||||
for i in range(24)
|
||||
]
|
||||
battery = _battery(uc_wh=64_000.0, min_pct=12.0, arb_pct=20.0)
|
||||
battery.planner_terminal_soc_value_factor = 0.0
|
||||
hp = SimpleNamespace(rated_heating_power_w=0, tuv_min_temp_c=45.0, tuv_target_temp_c=55.0)
|
||||
grid = SimpleNamespace(max_import_power_w=17_000, max_export_power_w=13_500)
|
||||
vehicles = [
|
||||
SimpleNamespace(max_charge_power_w=0, battery_capacity_kwh=1.0, default_target_soc_pct=80.0),
|
||||
SimpleNamespace(max_charge_power_w=0, battery_capacity_kwh=1.0, default_target_soc_pct=80.0),
|
||||
]
|
||||
results, _, _ = solve_dispatch(
|
||||
slots,
|
||||
battery,
|
||||
hp,
|
||||
grid,
|
||||
[None, None],
|
||||
vehicles,
|
||||
30_000.0,
|
||||
50.0,
|
||||
operating_mode="AUTO",
|
||||
)
|
||||
self.assertEqual(len(results), 24)
|
||||
|
||||
|
||||
class AutoPassiveNoLoadFollowingDischargeTests(unittest.TestCase):
|
||||
"""AUTO bez allow_discharge_export: žádný export do sítě (Deye PASSIVE)."""
|
||||
|
||||
Reference in New Issue
Block a user