Fix day label off-by-one in parse_open_meteo_forecast#613
Open
malawto wants to merge 1 commit intofatihak:mainfrom
Open
Fix day label off-by-one in parse_open_meteo_forecast#613malawto wants to merge 1 commit intofatihak:mainfrom
malawto wants to merge 1 commit intofatihak:mainfrom
Conversation
pjleduc
added a commit
to pjleduc/InkyPi
that referenced
this pull request
Mar 15, 2026
- calendar.py: skip failed calendar URLs instead of crashing plugin - weather.py: fix Open-Meteo forecast day label off-by-one (PR fatihak#613) - model.py: remove duplicate scheduled refresh logic - refresh_task.py: add 60s timeout to prevent indefinite hangs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix day label and moon phase off-by-one in
parse_open_meteo_forecastOpen-Meteo daily
timevalues are date strings (e.g."2026-02-27"), not datetimes. The previous code parsed them with.replace(tzinfo=timezone.utc).astimezone(tz), which stamped them as UTC midnight and then shifted them into local time — rolling each date back to the previous evening. This caused every forecast card to display the wrong day label and the wrong day's high/low temperatures.A
timedelta(days=1)offset ontarget_datein the moon phase calculation was silently compensating for this same bug, keeping moon phases accidentally correct.This PR fixes the date parsing by using
date.fromisoformat()directly, and removes thetimedelta(days=1)offset that was masking the original error. The result is correct day labels, correct temperatures in each forecast card, and correct moon phases.