From 0743b9e2bbe95739bbb3f58ae33bae0a705a85ab Mon Sep 17 00:00:00 2001 From: Matt Walsh Date: Thu, 5 Jan 2023 14:19:33 -0600 Subject: [PATCH] filter current conditions for missing icon or current conditions --- server/scripts/modules/currentweather.mjs | 4 +++- server/scripts/modules/icons.mjs | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/server/scripts/modules/currentweather.mjs b/server/scripts/modules/currentweather.mjs index 14eb43f..5f89c84 100644 --- a/server/scripts/modules/currentweather.mjs +++ b/server/scripts/modules/currentweather.mjs @@ -53,7 +53,9 @@ class CurrentWeather extends WeatherDisplay { // test data quality if (observations.features[0].properties.temperature.value === null || observations.features[0].properties.windSpeed.value === null - || observations.features[0].properties.textDescription === null) { + || observations.features[0].properties.textDescription === null + || observations.features[0].properties.textDescription === '' + || observations.features[0].properties.icon === null) { observations = undefined; throw new Error(`Unable to get observations: ${station.properties.stationIdentifier}, trying next station`); } diff --git a/server/scripts/modules/icons.mjs b/server/scripts/modules/icons.mjs index b4d08a3..a851161 100644 --- a/server/scripts/modules/icons.mjs +++ b/server/scripts/modules/icons.mjs @@ -87,6 +87,7 @@ const getWeatherRegionalIconFromIconLink = (link, _isNightTime) => { return addPath('Light-Snow.gif'); case 'rain_snow': + case 'rain_snow-n': return addPath('Rain-Snow-1992.gif'); case 'snow_fzra':