diff --git a/package-lock.json b/package-lock.json index b3d1b8e..f580bd2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ws4kp", - "version": "5.26.0", + "version": "5.26.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ws4kp", - "version": "5.26.0", + "version": "5.26.2", "license": "MIT", "dependencies": { "dotenv": "^16.5.0", diff --git a/package.json b/package.json index 36c7959..6e47593 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ws4kp", - "version": "5.26.0", + "version": "5.26.2", "description": "Welcome to the WeatherStar 4000+ project page!", "main": "index.mjs", "type": "module", diff --git a/server/scripts/modules/currentweather.mjs b/server/scripts/modules/currentweather.mjs index ddcfeaa..8980979 100644 --- a/server/scripts/modules/currentweather.mjs +++ b/server/scripts/modules/currentweather.mjs @@ -153,7 +153,7 @@ class CurrentWeather extends WeatherDisplay { condition = shortConditions(condition); } - const wind = (typeof this.data.WindSpeed === 'number') ? this.data.WindDirection.padEnd(3, '') + this.data.WindSpeed.toString().padStart(3, ' ') : '-'; + const wind = (typeof this.data.WindSpeed === 'number') ? this.data.WindDirection.padEnd(3, '') + this.data.WindSpeed.toString().padStart(3, ' ') : this.data.WindSpeed; const fill = { temp: this.data.Temperature + String.fromCharCode(176), @@ -251,6 +251,9 @@ const parseData = (data) => { data.PressureDirection = ''; data.TextConditions = observations.textDescription; + // set wind speed of 0 as calm + if (data.WindSpeed === 0) data.WindSpeed = 'Calm'; + // difference since last measurement (pascals, looking for difference of more than 150) const pressureDiff = (observations.barometricPressure.value - data.features[1].properties.barometricPressure.value); if (pressureDiff > 150) data.PressureDirection = 'R';