mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
Added wind direction in Current Weather module
This commit is contained in:
parent
8d29bd5c32
commit
2aae0528b5
@ -19,7 +19,7 @@ Module.register("currentweather",{
|
|||||||
timeFormat: config.timeFormat,
|
timeFormat: config.timeFormat,
|
||||||
showPeriod: true,
|
showPeriod: true,
|
||||||
showPeriodUpper: false,
|
showPeriodUpper: false,
|
||||||
showDirection: true,
|
showDirection: false,
|
||||||
lang: config.language,
|
lang: config.language,
|
||||||
|
|
||||||
initialLoadDelay: 0, // 0 seconds delay
|
initialLoadDelay: 0, // 0 seconds delay
|
||||||
@ -114,13 +114,12 @@ Module.register("currentweather",{
|
|||||||
var windSpeed = document.createElement("span");
|
var windSpeed = document.createElement("span");
|
||||||
windSpeed.innerHTML = " " + this.windSpeed;
|
windSpeed.innerHTML = " " + this.windSpeed;
|
||||||
small.appendChild(windSpeed);
|
small.appendChild(windSpeed);
|
||||||
|
|
||||||
if (this.showDirection) {
|
if (this.config.showDirection) {
|
||||||
var windDirection = document.createElement("span");
|
var windDirection = document.createElement("span");
|
||||||
windDirection.innerHTML = " " + this.windDirection;
|
windDirection.innerHTML = " " + this.windDirection;
|
||||||
small.appendChild(windDirection);
|
small.appendChild(windDirection);
|
||||||
}
|
}
|
||||||
|
|
||||||
var spacer = document.createElement("span");
|
var spacer = document.createElement("span");
|
||||||
spacer.innerHTML = " ";
|
spacer.innerHTML = " ";
|
||||||
small.appendChild(spacer);
|
small.appendChild(spacer);
|
||||||
@ -206,9 +205,7 @@ 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));
|
this.windSpeed = this.ms2Beaufort(this.roundValue(data.wind.speed));
|
||||||
if (this.showDirection) {
|
this.windDirection = this.deg2Cardinal(data.wind.deg);
|
||||||
this.windDirection = this.deg2Cardinal(data.wind.deg);
|
|
||||||
} else {}
|
|
||||||
this.weatherType = this.config.iconTable[data.weather[0].icon];
|
this.weatherType = this.config.iconTable[data.weather[0].icon];
|
||||||
|
|
||||||
var now = new Date();
|
var now = new Date();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user