mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-21 19:19:31 -07:00
fix display of null wind speed
This commit is contained in:
@@ -112,10 +112,12 @@ class CurrentWeather extends WeatherDisplay {
|
|||||||
condition = shortConditions(condition);
|
condition = shortConditions(condition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const wind = (typeof this.data.WindSpeed === 'number') ? this.data.WindDirection.padEnd(3, '') + this.data.WindSpeed.toString().padStart(3, ' ') : '-';
|
||||||
|
|
||||||
const fill = {
|
const fill = {
|
||||||
temp: this.data.Temperature + String.fromCharCode(176),
|
temp: this.data.Temperature + String.fromCharCode(176),
|
||||||
condition,
|
condition,
|
||||||
wind: this.data.WindDirection.padEnd(3, '') + this.data.WindSpeed.toString().padStart(3, ' '),
|
wind,
|
||||||
location: locationCleanup(this.data.station.properties.name).substr(0, 20),
|
location: locationCleanup(this.data.station.properties.name).substr(0, 20),
|
||||||
humidity: `${this.data.Humidity}%`,
|
humidity: `${this.data.Humidity}%`,
|
||||||
dewpoint: this.data.DewPoint + String.fromCharCode(176),
|
dewpoint: this.data.DewPoint + String.fromCharCode(176),
|
||||||
@@ -202,7 +204,6 @@ const parseData = (data) => {
|
|||||||
data.WindSpeed = windConverter(observations.windSpeed.value);
|
data.WindSpeed = windConverter(observations.windSpeed.value);
|
||||||
data.WindDirection = directionToNSEW(observations.windDirection.value);
|
data.WindDirection = directionToNSEW(observations.windDirection.value);
|
||||||
data.WindGust = windConverter(observations.windGust.value);
|
data.WindGust = windConverter(observations.windGust.value);
|
||||||
data.WindSpeed = windConverter(data.WindSpeed);
|
|
||||||
data.WindUnit = windConverter.units;
|
data.WindUnit = windConverter.units;
|
||||||
data.Humidity = Math.round(observations.relativeHumidity.value);
|
data.Humidity = Math.round(observations.relativeHumidity.value);
|
||||||
data.Icon = getLargeIcon(observations.icon);
|
data.Icon = getLargeIcon(observations.icon);
|
||||||
|
|||||||
Reference in New Issue
Block a user