diff --git a/src/batcontrol/forecastsolar/solarprognose.py b/src/batcontrol/forecastsolar/solarprognose.py index 0f8ee4f8..3ece7648 100644 --- a/src/batcontrol/forecastsolar/solarprognose.py +++ b/src/batcontrol/forecastsolar/solarprognose.py @@ -62,8 +62,11 @@ def __init__(self, pvinstallations, timezone, min_time_between_api_calls, delay_evaluation_by_seconds: Delay for API evaluation target_resolution: Target resolution in minutes (15 or 60) """ + # Provider allows 20 calls/day; use 18 to leave 2 in reserve (~80 min). + # Integer arithmetic avoids float rounding; max() respects larger caller values. + _provider_min = 24 * 60 * 60 // 18 # 4800 s super().__init__(pvinstallations, timezone, - min_time_between_api_calls, delay_evaluation_by_seconds, + max(min_time_between_api_calls, _provider_min), delay_evaluation_by_seconds, target_resolution=target_resolution, native_resolution=60) # SolarPrognose provides hourly data