mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-28 04:02:12 +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: {
|
||||
weatherProvider: "openweathermap",
|
||||
roundTemp: false,
|
||||
type: "current",
|
||||
type: "current", // current, forecast, daily (equivalent to forecast), hourly (only with OpenWeatherMap /onecall endpoint)
|
||||
|
||||
lat: 0,
|
||||
lon: 0,
|
||||
@ -127,10 +127,17 @@ Module.register("weather", {
|
||||
|
||||
// Select the template depending on the display type.
|
||||
getTemplate: function () {
|
||||
if (this.config.type === "daily") {
|
||||
switch (this.config.type.toLowerCase()) {
|
||||
case "current":
|
||||
return `current.njk`;
|
||||
case "hourly":
|
||||
return `hourly.njk`;
|
||||
case "daily":
|
||||
case "forecast":
|
||||
return `forecast.njk`;
|
||||
}
|
||||
default:
|
||||
return `${this.config.type.toLowerCase()}.njk`;
|
||||
}
|
||||
},
|
||||
|
||||
// Add all the data to the template.
|
||||
|
Loading…
x
Reference in New Issue
Block a user