From decae10434b83b1d73cc06b634771f6d2225471c Mon Sep 17 00:00:00 2001 From: 7tobias Date: Fri, 22 Aug 2025 16:41:40 +0200 Subject: [PATCH] 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 --- src/akkudoktoreos/prediction/pvforecastakkudoktor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/akkudoktoreos/prediction/pvforecastakkudoktor.py b/src/akkudoktoreos/prediction/pvforecastakkudoktor.py index 21e1e03..587687b 100644 --- a/src/akkudoktoreos/prediction/pvforecastakkudoktor.py +++ b/src/akkudoktoreos/prediction/pvforecastakkudoktor.py @@ -254,7 +254,7 @@ class PVForecastAkkudoktor(PVForecastProvider): f"powerInverter={int(self.config.pvforecast.planes_inverter_paco[i])}" ) 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}")