Files
HeatGuard/internal/risk/thresholds.go
vikingowl 1c9db02334 feat: add web UI with full CRUD setup page
Add server-side rendered setup UI accessible via `heatwave web`.
The dashboard is now re-rendered per request and includes a nav bar
linking to the new /setup page. Setup provides full CRUD for profiles,
rooms, devices, occupants, AC units (with room assignment), scenario
toggles, and forecast fetching — all via POST/redirect/GET forms.

- Add ShowNav field to DashboardData for conditional nav bar
- Extract fetchForecastForProfile() for reuse by web handler
- Create setup.html.tmpl with Tailwind-styled entity sections
- Create web_handlers.go with 15 route handlers and flash cookies
- Switch web.go from pre-rendered to per-request dashboard rendering
- Graceful dashboard fallback when no forecast data exists
2026-02-09 10:39:00 +01:00

22 lines
726 B
Go

package risk
// Thresholds holds configurable temperature thresholds for risk analysis.
type Thresholds struct {
HotDayC float64 // daytime temp considered "hot" (default 30)
VeryHotDayC float64 // daytime temp considered "very hot" (default 35)
ExtremeDayC float64 // extreme heat (default 40)
PoorNightCoolingC float64 // night temp above which cooling is poor (default 20)
ComfortMaxC float64 // max indoor comfort temp (default 26)
}
// DefaultThresholds returns the default temperature thresholds.
func DefaultThresholds() Thresholds {
return Thresholds{
HotDayC: 30,
VeryHotDayC: 35,
ExtremeDayC: 40,
PoorNightCoolingC: 20,
ComfortMaxC: 26,
}
}