Swap hand-drawn weather icons for Environment Canada's real icon set
The hand-drawn glyphs (draw_cloud/draw_sun/draw_raindrop/draw_snowflake/ draw_lightning_bolt) are replaced by 7 vendored bitmaps, one per shared weather category, sourced from weather.gc.ca's public icon set -- these are small, flat-shaded images that dither cleanly onto the panel's 6-color palette and read as recognizable weather icons in a way the hand-drawn attempt (a plain circle-with-ticks "sun") didn't. Used for every provider's rendering (Open-Meteo, NWS, EC), not just when EC is selected. Vendored (not fetched live at render time), matching this project's existing convention for the Noto Emoji fonts -- server/app/weather_icons/ SOURCE.md documents the source, attribution, and the licensing caveat (this is a personal, non-commercial project; the icon images' own copyright terms are less clearly permissive than the weather data's own End-use Licence, since they're served from the public website rather than ECCC's data servers). draw_weather_icon's signature changes from (draw, cx, cy, r, category, palette_rgb) to (img, cx, cy, r, category): pasting a bitmap needs the Image object, not just an ImageDraw handle, and palette_rgb is no longer needed since the shared _quantize step already maps whatever's on the composited canvas to the frame's actual palette -- no per-icon color resolution required anymore.
This commit is contained in:
@@ -35,8 +35,8 @@ HEADERS = {"User-Agent": "espresso_frame-weather-widget (self-hosted photo frame
|
||||
# the same handful of categories Open-Meteo's _CODE_CATEGORIES maps WMO
|
||||
# codes to. "wind_"-prefixed variants (e.g. wind_skc) are just the same
|
||||
# sky condition plus wind -- stripped before lookup, since this project's
|
||||
# hand-drawn icons (app/weather_render.py) don't have a separate windy
|
||||
# glyph.
|
||||
# vendored icon set (app/weather_render.py, app/weather_icons/) doesn't
|
||||
# have a separate windy glyph.
|
||||
_ICON_CODE_CATEGORIES = {
|
||||
"skc": "clear", "clear": "clear",
|
||||
"few": "partly_cloudy", "sct": "partly_cloudy",
|
||||
|
||||
Reference in New Issue
Block a user