mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-28 12:12:20 +00:00
amended code according to pull request reviews
This commit is contained in:
parent
f6854f58ff
commit
a4d73e2a67
@ -11,7 +11,7 @@ Module.register("weather", {
|
|||||||
defaults: {
|
defaults: {
|
||||||
weatherProvider: "openweathermap",
|
weatherProvider: "openweathermap",
|
||||||
roundTemp: false,
|
roundTemp: false,
|
||||||
type: "current",
|
type: "current", // current, forecast, daily (equivalent to forecast), hourly (only with OpenWeatherMap /onecall endpoint)
|
||||||
|
|
||||||
lat: 0,
|
lat: 0,
|
||||||
lon: 0,
|
lon: 0,
|
||||||
@ -127,10 +127,17 @@ Module.register("weather", {
|
|||||||
|
|
||||||
// Select the template depending on the display type.
|
// Select the template depending on the display type.
|
||||||
getTemplate: function () {
|
getTemplate: function () {
|
||||||
if (this.config.type === "daily") {
|
switch (this.config.type.toLowerCase()) {
|
||||||
return `forecast.njk`;
|
case "current":
|
||||||
|
return `current.njk`;
|
||||||
|
case "hourly":
|
||||||
|
return `hourly.njk`;
|
||||||
|
case "daily":
|
||||||
|
case "forecast":
|
||||||
|
return `forecast.njk`;
|
||||||
|
default:
|
||||||
|
return `${this.config.type.toLowerCase()}.njk`;
|
||||||
}
|
}
|
||||||
return `${this.config.type.toLowerCase()}.njk`;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// Add all the data to the template.
|
// Add all the data to the template.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user