Make Beaufort wind speed optional

This commit is contained in:
Warwolf8.9 2016-05-03 19:14:27 -05:00
parent 5e68a8200d
commit 5725af55a8

View File

@ -20,6 +20,7 @@ Module.register("currentweather",{
showPeriod: true, showPeriod: true,
showPeriodUpper: false, showPeriodUpper: false,
showWindDirection: false, showWindDirection: false,
useBeaufort: true,
lang: config.language, lang: config.language,
initialLoadDelay: 0, // 0 seconds delay initialLoadDelay: 0, // 0 seconds delay
@ -204,7 +205,14 @@ Module.register("currentweather",{
*/ */
processWeather: function(data) { processWeather: function(data) {
this.temperature = this.roundValue(data.main.temp); this.temperature = this.roundValue(data.main.temp);
this.windSpeed = this.ms2Beaufort(this.roundValue(data.wind.speed));
if (this.config.useBeaufort){
this.windSpeed = this.ms2Beaufort(this.roundValue(data.wind.speed));
}else {
this.windSpeed = parseFloat(data.wind.speed).toFixed(0);
}
this.windDirection = this.deg2Cardinal(data.wind.deg); this.windDirection = this.deg2Cardinal(data.wind.deg);
this.weatherType = this.config.iconTable[data.weather[0].icon]; this.weatherType = this.config.iconTable[data.weather[0].icon];