mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-18 09:39:30 -07:00
detect stations not reporting critical values close #4
This commit is contained in:
@@ -32,6 +32,10 @@ class LatestObservations extends WeatherDisplay {
|
||||
const allConditions = await Promise.all(regionalStations.map(async station => {
|
||||
try {
|
||||
const data = await utils.fetch.json(`https://api.weather.gov/stations/${station.id}/observations/latest`);
|
||||
// test for temperature, weather and wind values present
|
||||
if (data.properties.temperature.value === null ||
|
||||
data.properties.textDescription === '' ||
|
||||
data.properties.windSpeed.value === null) return;
|
||||
// format the return values
|
||||
return Object.assign({}, data.properties, {
|
||||
StationId: station.id,
|
||||
|
||||
Reference in New Issue
Block a user