fix: ensure EV charge rates settings available
Some checks failed
Close stale pull requests/issues / Find Stale issues and PRs (push) Has been cancelled
docker-build / platform-excludes (push) Has been cancelled
pre-commit / pre-commit (push) Has been cancelled
Run Pytest on Pull Request / test (push) Has been cancelled
docker-build / build (push) Has been cancelled
docker-build / merge (push) Has been cancelled

Allow charge rates for electric vehicle to be provided by the POST
optimize endpoint. Create a default value in case neither the
parameters nor the configuration provide charge rates.

This is also to allow to migrate from 0.1.0 configuration format
to actual one.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
This commit is contained in:
Bobby Noelte
2025-10-30 17:11:30 +01:00
parent c911378bee
commit 18b580cabe
7 changed files with 63 additions and 13 deletions

View File

@@ -90,6 +90,11 @@ class ElectricVehicleParameters(BaseBatteryParameters):
initial_soc_percentage: int = initial_soc_percentage_field(
"An integer representing the current state of charge (SOC) of the battery in percentage."
)
charge_rates: Optional[list[float]] = Field(
default=None,
description="Charge rates as factor of maximum charging power [0.00 ... 1.00]. None denotes all charge rates are available.",
examples=[[0.0, 0.25, 0.5, 0.75, 1.0], None],
)
class HomeApplianceParameters(DeviceParameters):