Skip to content

Commit 49b19e0

Browse files
claudeMaStr
authored andcommitted
fix: use explicit UTC-aware now() for hour alignment in Solcast provider
Matches the baseclass pattern and makes the current-hour computation independent of the host timezone. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H5Q9tGhRPEWyc6t5H21DPW
1 parent 753ba55 commit 49b19e0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/batcontrol/forecastsolar/solcast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def get_forecast_from_raw_data(self) -> dict[int, float]:
8080
"""
8181
results = self.get_all_raw_data()
8282

83-
now = datetime.datetime.now().astimezone(self.timezone)
83+
now = datetime.datetime.now(datetime.timezone.utc).astimezone(self.timezone)
8484
current_hour_start = now.replace(minute=0, second=0, microsecond=0)
8585

8686
prediction = {}

0 commit comments

Comments
 (0)