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
23 lines
762 B
Go
23 lines
762 B
Go
package weather
|
|
|
|
import "context"
|
|
|
|
// Provider is the interface for weather data sources.
|
|
type Provider interface {
|
|
// FetchForecast retrieves hourly + daily forecasts for a location.
|
|
// The timezone parameter (e.g. "Europe/Berlin") controls the API's time axis.
|
|
FetchForecast(ctx context.Context, lat, lon float64, timezone string) (*ForecastResponse, error)
|
|
|
|
// Name returns the provider identifier (e.g., "openmeteo", "brightsky").
|
|
Name() string
|
|
}
|
|
|
|
// WarningProvider is the interface for weather warning sources.
|
|
type WarningProvider interface {
|
|
// FetchWarnings retrieves active heat warnings near the given location.
|
|
FetchWarnings(ctx context.Context, lat, lon float64) ([]Warning, error)
|
|
|
|
// Name returns the provider identifier.
|
|
Name() string
|
|
}
|