Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/batcontrol/forecastsolar/solarprognose.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down