Loading...
Searching...
No Matches
weather_store.h File Reference

Active weather store. It owns the appmessage weather channels and its place on the shared cadence, so a face just hands it the rules (live / poll interval), optionally seeds it, then reads the values and subscribes for repaints. The phone data flows straight in and nobody wires it. More...

#include <pebble.h>
#include "wire/weather_wire.h"

Go to the source code of this file.

Data Structures

struct  WeatherConfig
 The rules a face hands the store, built from its own settings so the store names no SETTING_*. More...
struct  WeatherSeed
 Optional prefill: shown until the first real reading lands, or pinned when live = false. More...

Macros

#define WEATHER_SEED_EMPTY

Functions

void weather_store_init (WeatherConfig cfg, const WeatherSeed *seed)
 Start the store with its rules. Pass seed = NULL for normal use.
void weather_store_reconfigure (WeatherConfig cfg)
 Re-apply the rules (e.g. the poll interval changed). Moves the next poll to the new interval, and switching the store off here stops it asking the phone.
void weather_store_subscribe (void(*cb)(void))
 Hand it the function to call when the weather changes (the screen redraw).
int weather_store_temp (void)
 The temperature reading in the user's unit, or WEATHER_NO_TEMP if we have not got one yet.
const char * weather_store_cond (void)
 The short word for the sky, or empty if we have not got one yet.
const char * weather_store_cond_label (void)
 The sky in words, such as "Partly Cloudy", for a face that declares WEATHER_CONDITION_LABEL.
int weather_store_humidity (void)
 The humidity in percent, or -1 if we have not got one yet.
int weather_store_wind_kmh (void)
 The wind speed in km/h, or -1 if we have not got one yet.
const char * weather_store_wind_dir (void)
 The wind direction like "NW", or empty if we have not got one yet.
int weather_store_sunrise (void)
 Sunrise as minutes past midnight, or -1 if we have not got one yet.
int weather_store_sunset (void)
 Sunset as minutes past midnight, or -1 if we have not got one yet.
int weather_store_feels_like (void)
 How warm it feels, or WEATHER_NO_TEMP if we have not got one yet.
int weather_store_pressure (void)
 The sea level pressure in hPa, or -1 if we have not got one yet.
int weather_store_dew_point (void)
 The dew point temperature, or WEATHER_NO_TEMP if we have not got one yet.
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.
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.
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.
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.
const WeatherHourly * weather_store_forecast_hourly (void)
 The hourly forecast strip, starting at the hour now.
const WeatherDaily * weather_store_forecast_daily (void)
 The daily forecast strip, starting today.
int weather_store_age_s (void)
 How many seconds since the last reading turned up, or -1 if we have none.

Detailed Description

Active weather store. It owns the appmessage weather channels and its place on the shared cadence, so a face just hands it the rules (live / poll interval), optionally seeds it, then reads the values and subscribes for repaints. The phone data flows straight in and nobody wires it.