mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-30 04:59:32 +00:00
Merge pull request #286 from roxasvalor/v2-beta
Added option for using the Beaufort scale or raw wind speed
This commit is contained in:
commit
3761bfd26f
@ -97,6 +97,13 @@ The following properties can be configured:
|
||||
<br><b>Default value:</b> <code>false</code>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>useBeaufort</code></td>
|
||||
<td>Pick between using the Beaufort scale for wind speed or using the default units.<br>
|
||||
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
|
||||
<br><b>Default value:</b> <code>true</code>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>lang</code></td>
|
||||
<td>The language of the days.<br>
|
||||
|
@ -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];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user