add special weather warning icons

This commit is contained in:
bignutty 2024-08-04 17:54:31 +02:00
parent d4879275e2
commit 6ad7afe8f8
3 changed files with 12 additions and 2 deletions

View file

@ -38,7 +38,7 @@ function renderWeatherCard(context, data, units){
if(data.result.warnings.length >= 1){
for(const w of data.result.warnings.splice(0, 1)){
if(description.includes(stringwrap(w.label, 50))) continue;
description += `\n\n${icon("warning")} **${stringwrap(w.label, 50)}**\n-# ${stringwrap(w.source, 50)}${link(w.url, "Learn More", "Learn more about this alert")}`
description += `\n\n${icon("weather_warning_" + (w.icon || "generic").toLowerCase())} **${stringwrap(w.label, 50)}**\n-# ${stringwrap(w.source, 50)}${link(w.url, "Learn More", "Learn more about this alert")}`
}
}