Use station data for current conditions; persist keys server-side
Station overlay:
- When Ambient Weather station data is present and fresh (<15 min),
its readings replace the model's current conditions: temp, feels-like,
humidity, dewpoint, wind speed/direction, gusts, pressure (inHg→hPa),
UV index, rain today, wind peek summary, and data-panel readouts
- A small "📡 My Station" badge appears in the hero when active
- applyStationOverlay() is called at the end of renderWeather (instant
if station data already loaded) and again whenever station data
refreshes (so the display stays live every 60 s)
- Hourly/daily forecasts continue to use Open-Meteo
Server-side key persistence:
- POST /api/ambient-config saves keys to data/ambient-config.json
(same persistent volume as VAPID and subscriptions)
- GET /api/ambient-config returns {configured: bool} without exposing keys
- /api/ambient checks query params → saved config → env vars in order
- Settings Save button posts keys to server after a successful test;
confirms "saved for all devices" in the status line
- On page load, if no localStorage keys but server is configured,
the station loads automatically on any device
This commit is contained in:
4 files changed
+151
-4
No files matched your search
@@ -64,6 +64,7 @@
|
||||
<div id="cur-icon" class="hero-icon"></div>
|
||||
<div id="cur-desc" class="hero-desc"></div>
|
||||
<div id="cur-precip" class="hero-sub"></div>
|
||||
<div id="station-badge" class="station-badge hidden">📡 <span id="station-badge-name">My Station</span></div>
|
||||
</div>
|
||||
<div class="hero-center">
|
||||
<div class="hero-temp"><span id="cur-temp">--</span><span class="deg">°F</span></div>
|
||||
|
||||
Reference in new issue
Block a user