66#define WEATHER_SEED_EMPTY ((WeatherSeed){ \
67 .temp = WEATHER_NO_TEMP, .cond = "", \
68 .humidity = -1, .wind_kmh = -1, .wind_dir = "", \
69 .cond_label = NULL, .sunrise = -1, .sunset = -1, .uv = -1, \
70 .temp_max = WEATHER_NO_TEMP, .temp_min = WEATHER_NO_TEMP, \
71 .precip_chance = -1, \
72 .feels_like = WEATHER_NO_TEMP, .pressure = -1, \
73 .dew_point = WEATHER_NO_TEMP, \
74 .forecast_hourly = NULL, .forecast_daily = NULL })
int weather_store_precip_chance(void)
Today's chance of rain in percent, or -1 if we have not got one yet or the day it came is over.
Definition weather_store.c:393
const WeatherDaily * weather_store_forecast_daily(void)
The daily forecast strip, starting today.
Definition weather_store.c:418
int weather_store_feels_like(void)
How warm it feels, or WEATHER_NO_TEMP if we have not got one yet.
Definition weather_store.c:394
int weather_store_wind_kmh(void)
The wind speed in km/h, or -1 if we have not got one yet.
Definition weather_store.c:386
const char * weather_store_wind_dir(void)
The wind direction like "NW", or empty if we have not got one yet.
Definition weather_store.c:387
void weather_store_reconfigure(WeatherConfig cfg)
Re-apply the rules (e.g. the poll interval changed). Moves the next poll to the new interval,...
Definition weather_store.c:362
const char * weather_store_cond(void)
The short word for the sky, or empty if we have not got one yet.
Definition weather_store.c:383
int weather_store_temp(void)
The temperature reading in the user's unit, or WEATHER_NO_TEMP if we have not got one yet.
Definition weather_store.c:370
int weather_store_temp_min(void)
Today's low, or WEATHER_NO_TEMP if we have not got one yet or the day it came is over.
Definition weather_store.c:392
void weather_store_subscribe(void(*cb)(void))
Hand it the function to call when the weather changes (the screen redraw).
Definition weather_store.c:289
int weather_store_dew_point(void)
The dew point temperature, or WEATHER_NO_TEMP if we have not got one yet.
Definition weather_store.c:396
void weather_store_init(WeatherConfig cfg, const WeatherSeed *seed)
Start the store with its rules. Pass seed = NULL for normal use.
Definition weather_store.c:294
int weather_store_sunset(void)
Sunset as minutes past midnight, or -1 if we have not got one yet.
Definition weather_store.c:389
int weather_store_age_s(void)
How many seconds since the last reading turned up, or -1 if we have none.
Definition weather_store.c:438
int weather_store_uv(void)
Today's UV index, or -1 if we have not got one yet or the day it came is over.
Definition weather_store.c:390
int weather_store_temp_max(void)
Today's high, or WEATHER_NO_TEMP if we have not got one yet or the day it came is over.
Definition weather_store.c:391
const WeatherHourly * weather_store_forecast_hourly(void)
The hourly forecast strip, starting at the hour now.
Definition weather_store.c:398
int weather_store_pressure(void)
The sea level pressure in hPa, or -1 if we have not got one yet.
Definition weather_store.c:395
const char * weather_store_cond_label(void)
The sky in words, such as "Partly Cloudy", for a face that declares WEATHER_CONDITION_LABEL.
Definition weather_store.c:384
int weather_store_sunrise(void)
Sunrise as minutes past midnight, or -1 if we have not got one yet.
Definition weather_store.c:388
int weather_store_humidity(void)
The humidity in percent, or -1 if we have not got one yet.
Definition weather_store.c:385
The rules a face hands the store, built from its own settings so the store names no SETTING_*.
Definition weather_store.h:25
bool live
True subscribes the channels and polls. False just keeps the fake data for screenshots.
Definition weather_store.h:26
int poll_min
Minutes between weather requests (e.g. 10, 20, 30).
Definition weather_store.h:27
uint32_t persist_key
Slot for the last good reading so the face owns the key instead of the store.
Definition weather_store.h:28
The 7-day strip. count is 0 until a reading lands.
Definition weather_wire.h:55
The hourly strip. count is 0 until a reading lands.
Definition weather_wire.h:46
Optional prefill: shown until the first real reading lands, or pinned when live = false.
Definition weather_store.h:36
int dew_point
Dew point temperature, WEATHER_NO_TEMP for none.
Definition weather_store.h:51
int humidity
Percent, -1 for none.
Definition weather_store.h:39
int temp_max
Today's high, WEATHER_NO_TEMP for none.
Definition weather_store.h:46
int wind_kmh
Wind in km/h, -1 for none.
Definition weather_store.h:40
int16_t temp
Reading in the user's unit, WEATHER_NO_TEMP for none.
Definition weather_store.h:37
int precip_chance
Chance of rain in percent, -1 for none.
Definition weather_store.h:48
int pressure
Sea level pressure in hPa, -1 for none.
Definition weather_store.h:50
const char * cond
Short word for the sky like "SUNNY".
Definition weather_store.h:38
int temp_min
Today's low, WEATHER_NO_TEMP for none.
Definition weather_store.h:47
const WeatherDaily * forecast_daily
Optional 7 day strip, NULL for none.
Definition weather_store.h:53
const char * cond_label
The sky in words like "Partly Cloudy", NULL or empty for none.
Definition weather_store.h:42
int16_t sunrise
Sunrise as minutes past midnight, -1 for none.
Definition weather_store.h:43
int feels_like
How warm it feels, WEATHER_NO_TEMP for none.
Definition weather_store.h:49
const char * wind_dir
Wind direction like "NW", empty for none.
Definition weather_store.h:41
int16_t sunset
Sunset as minutes past midnight, -1 for none.
Definition weather_store.h:44
int uv
UV index, -1 for none.
Definition weather_store.h:45
const WeatherHourly * forecast_hourly
Optional hourly strip, NULL for none.
Definition weather_store.h:52
The forecast strips as the phone packs them, and the readers that unpack them.