Skip to main content

Module weather

Module weather 

Source
Expand description

The weather at a place you chose, for a small applet in the status line: now, the next four hours one by one, then mornings, afternoons, evenings and nights; and for the phone’s card on the home screen (card, days): the hour under way, the next four, the next four parts of the day, then the next seven days. From Open-Meteo (no key; data CC BY 4.0, credited where shown: https://open-meteo.com/en/licence), in monochrome icons.

Structs§

Answer 🔒
Daily 🔒
Day
One day of forecast, at the place.
DaySlot
A day of the forecast, as the card shows it among the days to come.
Forecast
The forecast kept: the hours from now on, the days from the place’s today on, and when it was fetched.
Found 🔒
FoundPlace 🔒
Hour
One hour of forecast.
Hourly 🔒
Place
A place found by name.
Slot
One line of the applet: an hour, or a part of a day.
WeatherView
What the applet shows.

Constants§

CARD_HOURS
The hours the card shows one by one after the hour under way, on the same row as it (the owner’s choice, 8 October 2026: four, not two).
CARD_PARTS
The parts of the day the card shows after them.

Functions§

card
What the phone’s card shows of the weather at at (docs/android.md, “The card on the home screen”): the hour under way (“Now”), the next four hours, then the next four parts of the day that hold two hours of the forecast at least, each the next of its kind, in order: morning (6–12), afternoon (12–18), evening (18–24), night (0–6), named shortly (“Afternoon”, “Night”), since their order says which day they are. None when the forecast does not hold the hour under way.
daily 🔒
The days of the answer, each dated as the place counts: its midnight read at the place’s noon, so that a change of hour between now (the offset given) and that day does not move it to the day before.
days
The forecast’s days, as the card shows them: each with its short name, its icon, its high and low, its chance of rain.
degrees 🔒
describe
A WMO code as a word key and a Breeze icon, by day or night.
hour_slot 🔒
An hour, as a line or a cell says it.
parse
Reads Open-Meteo’s answer.
parse_places
The places found, with their region and country so namesakes are told apart.
part_slot 🔒
A part of a day, from its hours: the most marked weather of it, by day if any hour of it is; its lowest and highest; its highest chance of rain.
place_query
The query to find a place by its name, in your language.
query
The query for a place, times as Unix seconds: hourly, three days ahead (the phone’s card is written until the end of tomorrow, and each of its hours shows the parts of the day after it); daily, today and the eight days after (tomorrow’s card still shows seven days to come).
rain_words 🔒
Rain worth saying: a chance from 20 %.
view
The applet’s lines, from the forecast and the time now.