Show weather compensation summary banner on the Dashboard

New lib/ac-template.js factors the "which occupied AC template applies
right now" resolution out of scheduler.js (dedupes the tier-pick loop
that used to live separately in scheduler.js and status.js) into a
shared resolveOccupiedAcTier()/resolveGlobalOccupiedAcTemplate() pair.
GET /api/status now returns active_ac_template alongside weather_peak_c.

Dashboard shows a small banner above the zone grid: "Forecast high
today: XC" + "Aircon default: ON, 20C, High fan — Warm tier" — so staff
don't have to visit Settings to see what today's weather tier resolved
to.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
jtricerolph 2026-08-25 11:42:01 +00:00
parent e7a8153990
commit 5fc576aabd
6 changed files with 88 additions and 32 deletions

View file

@ -221,6 +221,14 @@ export interface HvacWeatherTier extends HvacAcTemplate {
peak_above_c: number
}
// What GET /api/status resolves as "the occupied AC template any room transitioning
// into occupied right now would get" — hvac_defaults.ac_occupied, or a weather tier
// override on top if one clears (tierApplied names it; null means the plain baseline
// applies). Doesn't reflect any individual room's own per-field overrides.
export interface ActiveAcTemplate extends HvacAcTemplate {
tierApplied: string | null
}
export interface HvacDefaults {
arrival_prep_offset_min: number
departure_prep_offset_min: number