make weatherprovider have a method for hourly fetching instead of a generic weatherData

This commit is contained in:
buxxi
2021-01-23 10:45:55 +01:00
parent d48113f2d9
commit e2cfa24686
6 changed files with 19 additions and 30 deletions

View File

@@ -56,8 +56,8 @@ WeatherProvider.register("openweathermap", {
.finally(() => this.updateAvailable());
},
// Overwrite the fetchWeatherData method.
fetchWeatherData() {
// Overwrite the fetchWeatherHourly method.
fetchWeatherHourly() {
this.fetchData(this.getUrl())
.then((data) => {
if (!data) {
@@ -69,7 +69,7 @@ WeatherProvider.register("openweathermap", {
this.setFetchedLocation(`(${data.lat},${data.lon})`);
const weatherData = this.generateWeatherObjectsFromOnecall(data);
this.setWeatherData(weatherData);
this.setWeatherHourly(weatherData.hours);
})
.catch(function (request) {
Log.error("Could not load data ... ", request);