diff --git a/modules/default/weather/current.njk b/modules/default/weather/current.njk
index e863eec4..ef09eb9c 100755
--- a/modules/default/weather/current.njk
+++ b/modules/default/weather/current.njk
@@ -1,7 +1,4 @@
-{% if current or weatherData %}
- {% if weatherData %}
- {% set current = weatherData.current %}
- {% endif %}
+{% if current %}
{% if not config.onlyTemp %}
diff --git a/modules/default/weather/forecast.njk b/modules/default/weather/forecast.njk
index a031d858..8fa04298 100644
--- a/modules/default/weather/forecast.njk
+++ b/modules/default/weather/forecast.njk
@@ -1,10 +1,5 @@
-{% if forecast or weatherData %}
- {% if weatherData %}
- {% set forecast = weatherData.days %}
- {% set numSteps = forecast | calcNumEntries %}
- {% else %}
- {% set numSteps = forecast | calcNumSteps %}
- {% endif %}
+{% if forecast %}
+ {% set numSteps = forecast | calcNumSteps %}
{% set currentStep = 0 %}
{% set forecast = forecast.slice(0, numSteps) %}
diff --git a/modules/default/weather/hourly.njk b/modules/default/weather/hourly.njk
index 6fe17f6e..3950ece2 100644
--- a/modules/default/weather/hourly.njk
+++ b/modules/default/weather/hourly.njk
@@ -1,7 +1,4 @@
-{% if hourly or weatherData %}
- {% if weatherData %}
- {% set hourly = weatherData.hours %}
- {% endif %}
+{% if hourly %}
{% set numSteps = hourly | calcNumEntries %}
{% set currentStep = 0 %}
@@ -29,4 +26,4 @@
{% endif %}
-
+
diff --git a/modules/default/weather/providers/openweathermap.js b/modules/default/weather/providers/openweathermap.js
index ba8a22a3..fd9b3244 100755
--- a/modules/default/weather/providers/openweathermap.js
+++ b/modules/default/weather/providers/openweathermap.js
@@ -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);
diff --git a/modules/default/weather/weather.js b/modules/default/weather/weather.js
index b2214105..d6678134 100644
--- a/modules/default/weather/weather.js
+++ b/modules/default/weather/weather.js
@@ -141,7 +141,7 @@ Module.register("weather", {
config: this.config,
current: this.weatherProvider.currentWeather(),
forecast: this.weatherProvider.weatherForecast(),
- weatherData: this.weatherProvider.weatherData(),
+ hourly: this.weatherProvider.weatherHourly(),
indoor: {
humidity: this.indoorHumidity,
temperature: this.indoorTemperature
@@ -172,7 +172,7 @@ Module.register("weather", {
this.weatherProvider.fetchCurrentWeather();
break;
case "hourly":
- this.weatherProvider.fetchWeatherData();
+ this.weatherProvider.fetchWeatherHourly();
break;
case "daily":
case "forecast":
diff --git a/modules/default/weather/weatherprovider.js b/modules/default/weather/weatherprovider.js
index 8642e9a4..2d031b2e 100644
--- a/modules/default/weather/weatherprovider.js
+++ b/modules/default/weather/weatherprovider.js
@@ -16,7 +16,7 @@ var WeatherProvider = Class.extend({
// Try to not access them directly.
currentWeatherObject: null,
weatherForecastArray: null,
- weatherDataObject: null,
+ weatherHourlyArray: null,
fetchedLocationName: null,
// The following properties will be set automatically.
@@ -57,10 +57,10 @@ var WeatherProvider = Class.extend({
Log.warn(`Weather provider: ${this.providerName} does not subclass the fetchWeatherForecast method.`);
},
- // This method should start the API request to fetch the weather forecast.
+ // This method should start the API request to fetch the weather hourly.
// This method should definitely be overwritten in the provider.
- fetchWeatherData: function () {
- Log.warn(`Weather provider: ${this.providerName} does not subclass the fetchWeatherData method.`);
+ fetchWeatherHourly: function () {
+ Log.warn(`Weather provider: ${this.providerName} does not subclass the fetchWeatherHourly method.`);
},
// This returns a WeatherDay object for the current weather.
@@ -74,8 +74,8 @@ var WeatherProvider = Class.extend({
},
// This returns an object containing WeatherDay object(s) depending on the type of call.
- weatherData: function () {
- return this.weatherDataObject;
+ weatherHourly: function () {
+ return this.weatherHourlyArray;
},
// This returns the name of the fetched location or an empty string.
@@ -95,9 +95,9 @@ var WeatherProvider = Class.extend({
this.weatherForecastArray = weatherForecastArray;
},
- // Set the weatherDataObject and notify the delegate that new information is available.
- setWeatherData: function (weatherDataObject) {
- this.weatherDataObject = weatherDataObject;
+ // Set the weatherHourlyArray and notify the delegate that new information is available.
+ setWeatherHourlyData: function (weatherHourlyArray) {
+ this.weatherHourlyArray = weatherHourlyArray;
},
// Set the fetched location name.