mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-07-02 05:53:21 +00:00
commit
d43679d59e
@ -9,7 +9,11 @@
|
|||||||
{% if config.useBeaufort %}
|
{% if config.useBeaufort %}
|
||||||
{{ current.beaufortWindSpeed() | round }}
|
{{ current.beaufortWindSpeed() | round }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ current.windSpeed | round }}
|
{% if config.useKmh %}
|
||||||
|
{{ current.kmhWindSpeed() | round }}
|
||||||
|
{% else %}
|
||||||
|
{{ current.windSpeed | round }}
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if config.showWindDirection %}
|
{% if config.showWindDirection %}
|
||||||
<sup>
|
<sup>
|
||||||
|
@ -18,6 +18,7 @@ Module.register("weather", {
|
|||||||
location: false,
|
location: false,
|
||||||
locationID: false,
|
locationID: false,
|
||||||
units: config.units,
|
units: config.units,
|
||||||
|
useKmh: false,
|
||||||
|
|
||||||
tempUnits: config.units,
|
tempUnits: config.units,
|
||||||
windUnits: config.units,
|
windUnits: config.units,
|
||||||
|
@ -77,6 +77,11 @@ class WeatherObject {
|
|||||||
return 12;
|
return 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
kmhWindSpeed() {
|
||||||
|
const windInKmh = this.windUnits === "imperial" ? this.windSpeed * 1.609344 : (this.windSpeed * 60 * 60) / 1000;
|
||||||
|
return windInKmh;
|
||||||
|
}
|
||||||
|
|
||||||
nextSunAction() {
|
nextSunAction() {
|
||||||
return moment().isBetween(this.sunrise, this.sunset) ? "sunset" : "sunrise";
|
return moment().isBetween(this.sunrise, this.sunset) ? "sunset" : "sunrise";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user