fixed config parameter typo

This commit is contained in:
Bryan Zhu
2020-06-30 04:18:03 -04:00
parent 4a162543f6
commit a4df38d963
2 changed files with 6 additions and 8 deletions

View File

@@ -66,7 +66,7 @@ WeatherProvider.register("openweathermap", {
return; return;
} }
this.setFetchedLocation(`(${data.lat},${data.lon})`); this.setFetchedLocation(`${data.lat},${data.lon}`);
const wData = this.generateWeatherObjectsFromOnecall(data); const wData = this.generateWeatherObjectsFromOnecall(data);
this.setWeatherData(wData); this.setWeatherData(wData);

View File

@@ -155,14 +155,12 @@ Module.register("weather", {
} }
setTimeout(() => { setTimeout(() => {
if (this.config.type === "wDataCurrent" if (this.config.type === "forecast") {
|| this.config.type === "wDataHourly"
|| this.config.type === "wDataDaily") {
this.weatherProvider.fetchWeatherData();
} else if (this.config.type === "forecast") {
this.weatherProvider.fetchWeatherForecast(); this.weatherProvider.fetchWeatherForecast();
} else { } else if (this.config.type === "current") {
this.weatherProvider.fetchCurrentWeather(); this.weatherProvider.fetchCurrentWeather();
} else {
this.weatherProvider.fetchWeatherData();
} }
}, nextLoad); }, nextLoad);
}, },
@@ -271,7 +269,7 @@ Module.register("weather", {
this.nunjucksEnvironment().addFilter( this.nunjucksEnvironment().addFilter(
"calcNumEntries", "calcNumEntries",
function (dataArray) { function (dataArray) {
return Math.min(dataArray.length, this.config.maxNumberOfEntries); return Math.min(dataArray.length, this.config.maxEntries);
}.bind(this) }.bind(this)
); );