fix(planning): accept full SoC targets and clarify unlimited EV SoC age (#1407)

* fix(devices): allow charging targets equal to the maximum SoC

* test(planning): protect EV SoC without age limits
This commit is contained in:
Andreas
2026-10-14 15:46:41 +02:00
committed by GitHub
parent 1f2faf3f7e
commit cab088f09b
5 changed files with 157 additions and 2 deletions
@@ -315,8 +315,8 @@ class BatteriesCommonSettings(DevicesBaseSettings):
@model_validator(mode="after")
def _validate_soc_range(self) -> "BatteriesCommonSettings":
if self.min_soc_percentage >= self.max_soc_percentage:
raise ValueError("min_soc_percentage must be < max_soc_percentage")
if self.min_soc_percentage > self.max_soc_percentage:
raise ValueError("min_soc_percentage must be <= max_soc_percentage")
if (
self.min_charge_power_w is not None
and self.max_charge_power_w is not None