Commit graph

6 commits

Author SHA1 Message Date
c6be990f6b Revert precip% hiding; headline now says 'slim chance of rain' instead
Wrong direction on the previous fix -- hiding the number lost real
information. Better fix: when no hour's icon is rain-classified but there's
still a real (if low) numeric precip_prob somewhere in the day, the
headline now says 'Mostly dry, slim chance of rain' instead of a flat 'Dry
today' that silently disagreed with a 5% sitting on an hour card. Rain% is
shown unconditionally again everywhere (hourly cards, next-2-days cards,
the Now hero line).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-25 13:21:14 +00:00
e4f4f031ef Fix: migrate forecast_points.wind_dir_deg on existing deployments
CREATE TABLE IF NOT EXISTS is a no-op against a table that already exists —
it doesn't add columns introduced after the first deploy. The live LXC's
forecast_points was created before wind_dir_deg existed, so every insert
in lib/weather-fetch.js has been failing with 'column wind_dir_deg of
relation forecast_points does not exist' since that feature landed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-25 13:08:50 +00:00
435b59b3fe Add plain-language summary + umbrella tip for today
Neither Met Office's Global Spot API nor Open-Meteo return a narrative text
summary -- both are purely numeric/coded. New lib/summary.js derives one
rule-based from today's already-fetched hourly points (icon + precip_prob),
no extra API call, no LLM:
- Headline: "Scattered showers today", "Rain likely later", "Heavy rain
  today", "Dry today", etc. -- compares rain distribution across the whole
  day vs specifically the hours still ahead of "now".
- Note: "Thunderstorms possible", appended when a thunder icon shows up.
- Umbrella nudge: shown when there's a real rain chance now or later today.

Computed fresh per-request (not cached at fetch time), since "later" means
later than whoever's looking at the screen right now, not later than the
last hourly refresh.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-25 13:03:24 +00:00
7f3ff4495c Add editable display title (was hardcoded to VITE_HOTEL_NAME)
New `config` table + routes/config.js: GET /api/public/config (no auth,
Display.tsx needs it with no session) and PUT /api/admin/config (authed +
'settings' cap). A blank title clears the override and falls back to the
build-time VITE_HOTEL_NAME, so an unconfigured install still shows
something sensible. Admin.tsx gets a "Display title" field above the
existing status card.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-25 12:53:09 +00:00
0a6eec65e7 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>
2026-08-25 12:48:11 +00:00
f977a5778f Scaffold weather app: reception forecast display + shared internal API
- Backend: Fastify service polling Met Office DataHub (Global Spot: hourly,
  three-hourly, daily endpoints) with Open-Meteo fallback, hourly refresh.
  Reuses settings' hotel_location/met_office integrations (same pattern as
  hvac's lib/weather.js) rather than its own credential copy.
- Three display tiers stored in one forecast_points table: today (hourly),
  next 2 days (3-hourly), days 4-7 (plain daily) - 7 days total.
- Public /api/public/forecast (no auth) feeds the reception kiosk display;
  /api/internal/forecast (WEATHER_SECRET bearer) lets other apps read the
  stored forecast instead of polling providers themselves; /api/admin/*
  (normal JWT + settings cap) is the staff status/refresh page.
- Frontend: root / is the public full-screen Display (no AuthGate at all -
  first genuinely public app in the stack); /admin is the authed status
  page. apps.base_path is /weather/admin so the portal card opens the
  admin view directly, precedented by forecasting's history sub-route.
- LXC 131 / 10.10.10.131, registered in auth/src/db.js, push-to-forgejo.sh,
  and stack-init/install-stack.sh (deploy_weather + --only dispatch + full
  install chain).
- Typechecks and builds clean; not yet deployed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-25 12:22:53 +00:00