From 5725af55a83d7fa5284143bd080f7c301ab2003a Mon Sep 17 00:00:00 2001 From: "Warwolf8.9" Date: Tue, 3 May 2016 19:14:27 -0500 Subject: [PATCH] Make Beaufort wind speed optional --- modules/default/currentweather/currentweather.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index 4ab04c4f..fb557935 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -20,6 +20,7 @@ Module.register("currentweather",{ showPeriod: true, showPeriodUpper: false, showWindDirection: false, + useBeaufort: true, lang: config.language, initialLoadDelay: 0, // 0 seconds delay @@ -204,7 +205,14 @@ Module.register("currentweather",{ */ processWeather: function(data) { 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.weatherType = this.config.iconTable[data.weather[0].icon];