feat: add weather source entity and weather-reactive CSS source type
Some checks failed
Lint & Test / test (push) Failing after 34s
Some checks failed
Lint & Test / test (push) Failing after 34s
New standalone WeatherSource entity with pluggable provider architecture (Open-Meteo v1, free, no API key). Full CRUD, test endpoint, browser geolocation, IconSelect provider picker, CardSection with test/clone/edit. WeatherColorStripStream maps WMO weather codes to ambient color palettes with temperature hue shifting and thunderstorm flash effects. Ref-counted WeatherManager polls API and caches data per source. CSS editor integration: weather type with EntitySelect source picker, speed and temperature influence sliders. Backup/restore support. i18n for en/ru/zh.
This commit is contained in:
47
TODO.md
Normal file
47
TODO.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# Weather Source Implementation
|
||||
|
||||
## Phase 1: Backend — Entity & Provider
|
||||
|
||||
- [x] `storage/weather_source.py` — WeatherSource dataclass
|
||||
- [x] `storage/weather_source_store.py` — BaseJsonStore, CRUD, ID prefix `ws_`
|
||||
- [x] `api/schemas/weather_sources.py` — Create/Update/Response Pydantic models
|
||||
- [x] `api/routes/weather_sources.py` — REST CRUD + `POST /{id}/test` endpoint
|
||||
- [x] `core/weather/weather_provider.py` — WeatherData, WeatherProvider ABC, OpenMeteoProvider, WMO_CONDITION_NAMES
|
||||
- [x] `core/weather/weather_manager.py` — Ref-counted runtime pool, polls API, caches WeatherData
|
||||
- [x] `config.py` — Add `weather_sources_file` to StorageConfig
|
||||
- [x] `main.py` — Init store + manager, inject dependencies, shutdown save
|
||||
- [x] `api/__init__.py` — Register router
|
||||
- [x] `api/routes/backup.py` — Add to STORE_MAP
|
||||
|
||||
## Phase 2: Backend — CSS Stream
|
||||
|
||||
- [x] `core/processing/weather_stream.py` — WeatherColorStripStream with WMO palette mapping + temperature shift + thunderstorm flash
|
||||
- [x] `core/processing/color_strip_stream_manager.py` — Register `"weather"` stream type + weather_manager dependency
|
||||
- [x] `storage/color_strip_source.py` — WeatherColorStripSource dataclass + registry
|
||||
- [x] `api/schemas/color_strip_sources.py` — Add `"weather"` to Literal + weather_source_id, temperature_influence fields
|
||||
- [x] `core/processing/processor_manager.py` — Pass weather_manager through ProcessorDependencies
|
||||
|
||||
## Phase 3: Frontend — Weather Source Entity
|
||||
|
||||
- [x] `templates/modals/weather-source-editor.html` — Modal with provider select, lat/lon + "Use my location", update interval, test button
|
||||
- [x] `static/js/features/weather-sources.ts` — Modal, CRUD, test (shows weather toast), clone, geolocation, CardSection delegation
|
||||
- [x] `static/js/core/state.ts` — weatherSourcesCache + _cachedWeatherSources
|
||||
- [x] `static/js/types.ts` — WeatherSource interface + ColorStripSource weather fields
|
||||
- [x] `static/js/features/streams.ts` — Weather Sources CardSection + card renderer + tree nav
|
||||
- [x] `templates/index.html` — Include modal template
|
||||
- [x] `static/css/modal.css` — Weather location row styles
|
||||
|
||||
## Phase 4: Frontend — CSS Editor Integration
|
||||
|
||||
- [x] `static/js/features/color-strips.ts` — `"weather"` type, section map, handler, card renderer, populate dropdown
|
||||
- [x] `static/js/core/icons.ts` — Weather icon in CSS type icons
|
||||
- [x] `templates/modals/css-editor.html` — Weather section (EntitySelect for weather source, speed, temperature_influence)
|
||||
|
||||
## Phase 5: i18n + Build
|
||||
|
||||
- [x] `static/locales/en.json` — Weather source + CSS editor keys
|
||||
- [x] `static/locales/ru.json` — Russian translations
|
||||
- [x] `static/locales/zh.json` — Chinese translations
|
||||
- [x] Lint: `ruff check` — passed
|
||||
- [x] Build: `tsc --noEmit` + `npm run build` — passed
|
||||
- [ ] Restart server + test
|
||||
Reference in New Issue
Block a user