Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions packages/control/ev/charge_template_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ def data_module() -> None:
pytest.param({"0": TimeChargingPlan(id=0, limit=Limit(selected="soc"))}, None, 0,
TimeChargingPlan(id=0, limit=Limit(selected="soc")),
(16, "time_charging", None, 0, 1), id="plan active, soc is not defined"),
pytest.param({"0": TimeChargingPlan(id=0, limit=Limit(selected="amount"))}, 0, 1500,
TimeChargingPlan(id=0, limit=Limit(selected="amount")),
pytest.param({"0": TimeChargingPlan(id=0, limit=Limit(selected="amount", amount=1000))}, 0, 1500,
TimeChargingPlan(id=0, limit=Limit(selected="amount", amount=1000)),
(0, "stop", ChargeTemplate.TIME_CHARGING_AMOUNT_REACHED, 0, 1),
id="plan active, used_amount_time_charging is reached"),
pytest.param({"0": TimeChargingPlan(id=0, limit=Limit(selected="amount"))}, 0, 500,
TimeChargingPlan(id=0, limit=Limit(selected="amount")),
pytest.param({"0": TimeChargingPlan(id=0, limit=Limit(selected="amount", amount=1000))}, 0, 500,
TimeChargingPlan(id=0, limit=Limit(selected="amount", amount=1000)),
(16, "time_charging", None, 0, 1),
id="plan active, used_amount_time_charging is not reached"),
pytest.param({"0": TimeChargingPlan(id=0)}, 0, 0, None,
Expand Down Expand Up @@ -91,6 +91,7 @@ def test_instant_charging(selected: str, current_soc: float, used_amount: float,
data.data.optional_data.data.et.active = False
ct = ChargeTemplate()
ct.data.chargemode.instant_charging.limit.selected = selected
ct.data.chargemode.instant_charging.limit.amount = 1000

# execution
ret = ct.instant_charging(current_soc, used_amount, ChargingType.AC.value)
Expand Down Expand Up @@ -124,6 +125,7 @@ def test_pv_charging(min_soc: int,
ct.data.chargemode.pv_charging.phases_to_use = 0
ct.data.chargemode.pv_charging.phases_to_use_min_soc = 3
ct.data.chargemode.pv_charging.limit.selected = limit_selected
ct.data.chargemode.pv_charging.limit.amount = 1000
ct.data.chargemode.pv_charging.limit.soc = 90
data.data.bat_all_data.data.config.configured = True

Expand Down
2 changes: 1 addition & 1 deletion packages/helpermodules/abstract_plans.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def time_factory():
@dataclass
class Limit:
selected: str = "none"
amount: int = 1000
amount: int = 50000
soc: int = 50


Expand Down