Skip to content

fix: tolerate null values in open-meteo hourly forecast arrays#99

Open
bvweerd wants to merge 1 commit into
devfrom
claude/functionality-bug-review-cfa5uw-weather-null
Open

fix: tolerate null values in open-meteo hourly forecast arrays#99
bvweerd wants to merge 1 commit into
devfrom
claude/functionality-bug-review-cfa5uw-weather-null

Conversation

@bvweerd

@bvweerd bvweerd commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Description

Open-meteo occasionally returns null for individual hours in the hourly arrays (typically at the forecast edge). float(None) raised TypeError, which the extraction block converted into UpdateFailed for the whole weather update — even though the remaining ~47 hours of data were perfectly usable. Consequence: the PV forecast degrades to the previous (aging) snapshot, and after WEATHER_STALE_AFTER_MINUTES a weather_data_stale repair issue appears, until a later poll happens to return a fully populated response.

Fix: coerce null entries to 0.0 in radiation / DNI / diffuse / wind / temperature. Zero radiation or wind is a safe neutral value for a single hour, and a null temperature mapped to 0 °C can never trigger the >25 °C panel derating. Genuinely malformed values (non-numeric strings) still raise UpdateFailed as before.

Type of change

  • fix: Bug fix (patch version bump)
  • feat: New feature (minor version bump)
  • feat!: / BREAKING CHANGE: Breaking change (major version bump)
  • chore: / docs: / ci: Maintenance or documentation (no version bump)

Checklist

  • Commit title follows Conventional Commits (feat:, fix:, chore:, etc.)
  • Tests added or updated where applicable
  • Documentation updated if needed
  • CI is green (local: pytest + pre-commit + mypy pass)
  • PR targets the dev branch (not main, unless this is a hotfix)

Screenshots / Logs (optional)

New test: test_async_update_data_null_values_treated_as_zero.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XWQRQEJXUxbp2CGFS18U9i


Generated by Claude Code

Open-meteo occasionally returns null for individual hours, typically at
the forecast edge. float(None) raised TypeError, which turned the whole
weather update into UpdateFailed even though the remaining 47 hours of
data were perfectly usable — degrading the PV forecast (and after the
stale window, raising a repair issue) until a later poll happened to
return a fully populated response.

Coerce null entries to 0.0 instead. A zero radiation/wind hour is a safe
neutral value, and a null temperature of 0.0 cannot trigger the >25 C
panel derating.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XWQRQEJXUxbp2CGFS18U9i
@github-actions github-actions Bot added the bug Something isn't working as expected label Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants