fix(ledmatrix-weather): keep the radar timestamp on the panel - #392
Merged
Conversation
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>
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 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. Comment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 8 |
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.
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.
The bug
weather_radar.pyresolved the 4x6 font three levels above itself: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:
check_plugin.pypasses 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.jsonalready 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_longitudeand bothdynamic_durationkeys 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_milesas50; the schema default is75.Harness
36 checks pass. Four fail —
almanacgolden drift at 64x32, 128x32, 128x64 and 256x32. I stashed this branch and re-ran against cleanmain: 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