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.
2.8 KiB
2.8 KiB
Weather Source Implementation
Phase 1: Backend — Entity & Provider
storage/weather_source.py— WeatherSource dataclassstorage/weather_source_store.py— BaseJsonStore, CRUD, ID prefixws_api/schemas/weather_sources.py— Create/Update/Response Pydantic modelsapi/routes/weather_sources.py— REST CRUD +POST /{id}/testendpointcore/weather/weather_provider.py— WeatherData, WeatherProvider ABC, OpenMeteoProvider, WMO_CONDITION_NAMEScore/weather/weather_manager.py— Ref-counted runtime pool, polls API, caches WeatherDataconfig.py— Addweather_sources_fileto StorageConfigmain.py— Init store + manager, inject dependencies, shutdown saveapi/__init__.py— Register routerapi/routes/backup.py— Add to STORE_MAP
Phase 2: Backend — CSS Stream
core/processing/weather_stream.py— WeatherColorStripStream with WMO palette mapping + temperature shift + thunderstorm flashcore/processing/color_strip_stream_manager.py— Register"weather"stream type + weather_manager dependencystorage/color_strip_source.py— WeatherColorStripSource dataclass + registryapi/schemas/color_strip_sources.py— Add"weather"to Literal + weather_source_id, temperature_influence fieldscore/processing/processor_manager.py— Pass weather_manager through ProcessorDependencies
Phase 3: Frontend — Weather Source Entity
templates/modals/weather-source-editor.html— Modal with provider select, lat/lon + "Use my location", update interval, test buttonstatic/js/features/weather-sources.ts— Modal, CRUD, test (shows weather toast), clone, geolocation, CardSection delegationstatic/js/core/state.ts— weatherSourcesCache + _cachedWeatherSourcesstatic/js/types.ts— WeatherSource interface + ColorStripSource weather fieldsstatic/js/features/streams.ts— Weather Sources CardSection + card renderer + tree navtemplates/index.html— Include modal templatestatic/css/modal.css— Weather location row styles
Phase 4: Frontend — CSS Editor Integration
static/js/features/color-strips.ts—"weather"type, section map, handler, card renderer, populate dropdownstatic/js/core/icons.ts— Weather icon in CSS type iconstemplates/modals/css-editor.html— Weather section (EntitySelect for weather source, speed, temperature_influence)
Phase 5: i18n + Build
static/locales/en.json— Weather source + CSS editor keysstatic/locales/ru.json— Russian translationsstatic/locales/zh.json— Chinese translations- Lint:
ruff check— passed - Build:
tsc --noEmit+npm run build— passed - Restart server + test