refactor icon finding scripts

This commit is contained in:
Matt Walsh
2025-05-14 15:03:35 -05:00
parent 7fae649357
commit e2877aad77
9 changed files with 365 additions and 363 deletions

View File

@@ -4,7 +4,7 @@ import { loadImg, preloadImg } from './utils/image.mjs';
import { json } from './utils/fetch.mjs';
import { directionToNSEW } from './utils/calc.mjs';
import { locationCleanup } from './utils/string.mjs';
import { getWeatherIconFromIconLink } from './icons.mjs';
import { getLargeIcon } from './icons.mjs';
import WeatherDisplay from './weatherdisplay.mjs';
import { registerDisplay } from './navigation.mjs';
import {
@@ -84,7 +84,7 @@ class CurrentWeather extends WeatherDisplay {
if (!superResult) return;
// preload the icon
preloadImg(getWeatherIconFromIconLink(observations.features[0].properties.icon));
preloadImg(getLargeIcon(observations.features[0].properties.icon));
this.setStatus(STATUS.loaded);
}
@@ -189,7 +189,7 @@ const parseData = (data) => {
data.WindSpeed = windConverter(data.WindSpeed);
data.WindUnit = windConverter.units;
data.Humidity = Math.round(observations.relativeHumidity.value);
data.Icon = getWeatherIconFromIconLink(observations.icon);
data.Icon = getLargeIcon(observations.icon);
data.PressureDirection = '';
data.TextConditions = observations.textDescription;