Skip to content

feat(examples): add Weather SDL2 app (Open-Meteo)#8

Open
lahirunirmalx wants to merge 3 commits into
m5stack:mainfrom
lahirunirmalx:app/weather
Open

feat(examples): add Weather SDL2 app (Open-Meteo)#8
lahirunirmalx wants to merge 3 commits into
m5stack:mainfrom
lahirunirmalx:app/weather

Conversation

@lahirunirmalx

Copy link
Copy Markdown

Port of the Phoebe LVGL app_weather to a standalone 320x170 SDL2 program. Fetches current conditions from the keyless Open-Meteo API on a background libcurl thread, parses the small flat JSON by hand (no JSON lib), and draws a procedurally animated icon (breathing sun / cloud / falling rain) chosen by WMO weather code. Code->category/text tables from Phoebe ui_common.h.

Config via env: WEATHER_LAT, WEATHER_LON, WEATHER_CITY (default Colombo).
Keys: ESC / Q quit.

Port of the Phoebe LVGL app_weather to a standalone 320x170 SDL2 program.
Fetches current conditions from the keyless Open-Meteo API on a background
libcurl thread, parses the small flat JSON by hand (no JSON lib), and draws
a procedurally animated icon (breathing sun / cloud / falling rain) chosen
by WMO weather code. Code->category/text tables from Phoebe ui_common.h.

Config via env: WEATHER_LAT, WEATHER_LON, WEATHER_CITY (default Colombo).
Keys: ESC / Q quit.
Press L (or M) in the weather view to open a keyboard-navigable list of
preset cities (Colombo, London, New York, ... 15 total). Arrows move, ENTER
selects, ESC cancels. Selecting a city updates the location under a mutex and
signals the fetch thread to refetch immediately (shows 'fetching...' then the
new city's conditions). WEATHER_LAT/LON/CITY env still seed the initial
location. Top-left 'L:loc' hint advertises the picker.

Verified in the emulator: picker lists cities, selecting London refetches and
renders London weather live.
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