Skip to content

weather: show a moon glyph on clear nights - #13

Open
dharmapoudel wants to merge 1 commit into
JoeyEamigh:devfrom
dharmapoudel:weather-moon-glyph
Open

dharmapoudel wants to merge 1 commit into
JoeyEamigh:devfrom
dharmapoudel:weather-moon-glyph

Conversation

@dharmapoudel

Copy link
Copy Markdown
Contributor

The current-conditions glyph always showed the sun for WMO code 0, even in the middle of the night.

What this does

  • Requests is_day from open-meteo alongside the existing current fields.
  • wmo() takes a night flag: code 0 at night renders the moon glyph instead of the sun. The label stays "clear" and the daily forecast tiles are untouched (they are day aggregates).
  • A missing is_day field falls back to the old daytime behavior, so nothing breaks if the API shape ever changes.

Files

  • packages/webapps/catalog/weather/src/App.tsx -- isDay on the forecast type, is_day in the request params and response parsing, night flag plumbed from ForecastView into wmo().

Validation

  • tsc --noEmit clean, vite build clean.
  • Logic test: day/night across clear, partly cloudy, overcast, rain, and thunderstorm codes, plus is_day missing/0/1 edge cases -- all pass.
  • Not tested on physical Car Thing hardware.

The current-conditions glyph always showed the sun for WMO code 0,
even at night. Request `is_day` from open-meteo and render the moon
glyph when it is night; the label stays "clear" and the daily tiles
are untouched (day aggregates). A missing `is_day` field falls back
to the old daytime behavior.
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