Display: wind dir/speed + rain%, sunrise/sunset, wrap today, merge Coming up
- Today's hourly cards and the next-2-days 3-hourly cards now always show rain chance% and wind (compass direction + mph), not just rain% above a 20% threshold. New wind_dir_deg column on forecast_points (Met Office windDirectionFrom10m / Open-Meteo winddirection_10m). - New forecast_astro table: sunrise/sunset for today + next 2 days, shown next to each day's section label. No extra API calls needed — both providers' daily responses already carry sunrise/sunset for those dates, just weren't being extracted before. - Today's hourly strip now sits in its own bordered block (wx-today-block) so it reads as a distinct group instead of blending into the cards below. - "Next 2 days" no longer has its own separate heading — tomorrow and the day after now sit under the single "Coming up" label, same as days 4-7. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
f977a5778f
commit
0a6eec65e7
6 changed files with 194 additions and 49 deletions
|
|
@ -30,6 +30,7 @@ export async function initDb() {
|
|||
feels_like_c NUMERIC,
|
||||
precip_prob NUMERIC,
|
||||
wind_speed_mph NUMERIC,
|
||||
wind_dir_deg NUMERIC,
|
||||
icon TEXT NOT NULL,
|
||||
condition_text TEXT,
|
||||
source TEXT NOT NULL,
|
||||
|
|
@ -37,7 +38,18 @@ export async function initDb() {
|
|||
UNIQUE (resolution, ts)
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS forecast_points_res_ts_idx ON forecast_points (resolution, ts);
|
||||
|
||||
-- Sunrise/sunset for today + the next 2 days — shown next to each day's label
|
||||
-- on the display. Only 3 rows at a time; replaced wholesale each refresh cycle
|
||||
-- alongside forecast_points (see lib/weather-fetch.js's replaceAstro()).
|
||||
CREATE TABLE IF NOT EXISTS forecast_astro (
|
||||
date TEXT PRIMARY KEY,
|
||||
sunrise TIMESTAMPTZ,
|
||||
sunset TIMESTAMPTZ,
|
||||
fetched_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||
);
|
||||
`)
|
||||
|
||||
}
|
||||
|
||||
export async function getStatus() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue