feat: add OWM alerts, UV index support, and provider info UI
- Parse OWM One Call 3.0 weather alerts and map to Warning structs - Map hourly UVI from OWM response to HourlyForecast.UVIndex - Add severity helper mapping OWM alert tags to severity levels - Extract UVIndex through compute layer to timeline slots - Smart warnings: use provider-supplied alerts, fall back to DWD - Show UV index in dashboard timeline tooltips - Add provider description below forecast dropdown with i18n
This commit is contained in:
@@ -995,13 +995,19 @@
|
||||
function toggleForecastApiKeyField(provider) {
|
||||
const group = document.getElementById("forecast-apikey-group");
|
||||
const hint = document.getElementById("forecast-provider-hint");
|
||||
const desc = document.getElementById("forecast-provider-desc");
|
||||
const ts = window.HG && window.HG.t ? window.HG.t : {};
|
||||
const providerDesc = (ts.setup && ts.setup.forecast && ts.setup.forecast.providerDesc) || {};
|
||||
if (provider === "openweathermap") {
|
||||
group.classList.remove("hidden");
|
||||
hint.innerHTML = '<a href="https://openweathermap.org/api/one-call-3" target="_blank" rel="noopener" class="text-orange-600 hover:underline">Requires One Call 3.0 subscription \u2192</a>';
|
||||
if (desc) desc.textContent = providerDesc.openweathermap || "48h hourly + 8-day daily forecast. Includes UV index and worldwide weather alerts.";
|
||||
} else {
|
||||
group.classList.add("hidden");
|
||||
hint.textContent = "";
|
||||
if (desc) desc.textContent = providerDesc.openmeteo || "Free, no API key needed. 3-day hourly forecast (temp, humidity, wind, solar, pressure). Warnings via DWD (Germany only).";
|
||||
}
|
||||
if (desc) desc.classList.remove("hidden");
|
||||
}
|
||||
|
||||
document.getElementById("forecast-provider-select").addEventListener("change", (e) => {
|
||||
|
||||
Reference in New Issue
Block a user