mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-30 13:09:34 +00:00
Make Beaufort wind speed optional
This commit is contained in:
parent
5e68a8200d
commit
5725af55a8
@ -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);
|
||||||
|
|
||||||
|
if (this.config.useBeaufort){
|
||||||
this.windSpeed = this.ms2Beaufort(this.roundValue(data.wind.speed));
|
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];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user