Skip to content

fix(ledmatrix-weather): keep the radar timestamp on the panel - #392

Merged
ChuckBuilds merged 2 commits into
mainfrom
docs/weather-readme
Sep 3, 2026
Merged

fix(ledmatrix-weather): keep the radar timestamp on the panel#392
ChuckBuilds merged 2 commits into
mainfrom
docs/weather-readme

Conversation

@ChuckBuilds

Copy link
Copy Markdown
Owner

The bug

weather_radar.py resolved the 4x6 font three levels above itself:

_FONT_PATH = Path(__file__).resolve().parent.parent.parent / "assets" / "fonts" / "4x6-font.ttf"

That is the LEDMatrix root only while the plugins directory sits inside the core tree. From anywhere else the load fails, ImageFont.load_default() takes over — taller than the 6px this overlay is laid out for — and the label drawn at (2, height - 8) runs past the bottom of the panel.

Measured on a 128x32 render, bottom rows:

row 28 row 29 row 30 row 31
before 27 20 28 22 lit, cut mid-glyph
after 20 23 1 0

check_plugin.py passes both ways — PIL clips at draw time, so a bounds check on what was requested cannot see what was lost. Rendering the screen for the README is what surfaced it. Same resolution pattern and same fix as #386.

README

The plugin had no images. It now has real renders of all five display modes and of current conditions at four panel sizes, produced from the recorded Open-Meteo response for Dallas that test/harness.json already ships — so they reproduce exactly rather than depending on today's weather.

The radar panel is the honest exception: its basemap and precipitation frames come from live tile servers, so the render shows only the overlay. The README says so rather than passing it off as a complete radar screen.

Settings: api_key, location_latitude, location_longitude and both dynamic_duration keys were undocumented. All 35 are now covered, and the config-token audit drops nothing but the two values below.

One correction: the table gave radar_range_miles as 50; the schema default is 75.

Harness

36 checks pass. Four fail — almanac golden drift at 64x32, 128x32, 128x64 and 256x32. I stashed this branch and re-ran against clean main: identical failures, identical pixel counts, so they pre-date this work. Filed as #391 with goldens untouched.

That is now the fourth plugin with unexplained golden drift on main (#371, #375, #378), which is starting to look like one shared cause rather than four.

2.6.5 → 2.6.6.

🤖 Generated with Claude Code

weather_radar.py resolved the 4x6 face three levels above itself, which is the
LEDMatrix root only when the plugins directory sits inside the core tree. From
anywhere else the load failed and PIL's default font took over -- taller than
the 6px the overlay is laid out for -- so the label at (2, height - 8) was
drawn past the bottom edge of the panel.

The safety harness passes either way: PIL clips at draw time, so a bounds check
on what was requested cannot see what was lost. Rendering the radar screen for
this README is what surfaced it -- the bottom row of the panel had 22 lit
pixels cut mid-glyph. After the fix the label ends two rows clear of the edge.

README: real rendered screenshots of all five display modes and of the current
conditions screen at four panel sizes, from the recorded Open-Meteo response
the test harness already ships, so they reproduce exactly. Documents api_key,
location_latitude, location_longitude and both dynamic_duration keys, taking
the plugin to 35 of 35 settings.

Corrects the radar_range_miles default, which the table gave as 50 where the
schema says 75.

check_plugin.py: 36 pass, 4 pre-existing almanac golden drifts that reproduce
identically on main without this branch -- filed as #391, goldens untouched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 95a24c13-b10f-4929-b95f-5fcd13f8d1e8


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

codacy-production Bot commented Sep 3, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 8 complexity

Metric Results
Complexity 8

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@ChuckBuilds
ChuckBuilds merged commit 33ec207 into main Sep 3, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant