mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2025-08-23 14:02:24 +00:00
fix: handle float values in userhorizon configuration (#657)
Replace int() with round() when converting userhorizon values to properly handle float values in the configuration. This prevents validation errors when users provide horizon angles with decimal precision. The Akkudoktor API expects integer values, so rounding to the nearest integer maintains compatibility while accepting float inputs. Fixes #647 Co-authored-by: Tobias Welz <tobias-wizneteu@gmail.com>
This commit is contained in:
parent
cacb21529b
commit
decae10434
@ -254,7 +254,7 @@ class PVForecastAkkudoktor(PVForecastProvider):
|
|||||||
f"powerInverter={int(self.config.pvforecast.planes_inverter_paco[i])}"
|
f"powerInverter={int(self.config.pvforecast.planes_inverter_paco[i])}"
|
||||||
)
|
)
|
||||||
horizon_values = ",".join(
|
horizon_values = ",".join(
|
||||||
str(int(h)) for h in self.config.pvforecast.planes_userhorizon[i]
|
str(round(h)) for h in self.config.pvforecast.planes_userhorizon[i]
|
||||||
)
|
)
|
||||||
query_params.append(f"horizont={horizon_values}")
|
query_params.append(f"horizont={horizon_values}")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user