mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
Fix for weather module not refreshing data after exception
This commit is contained in:
parent
776c486b1a
commit
819c4cde1c
@ -19,6 +19,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
### Fixed
|
||||
- Updatenotification module: Properly handle race conditions, prevent crash.
|
||||
- Send `NEWS_FEED` notification also for the first news messages which are shown
|
||||
- Fixed issue where weather module would not refresh data after a network or API outage [#1722](https://github.com/MichMich/MagicMirror/issues/1722)
|
||||
|
||||
## [2.8.0] - 2019-07-01
|
||||
|
||||
|
@ -32,7 +32,8 @@ WeatherProvider.register("darksky", {
|
||||
this.setCurrentWeather(currentWeather);
|
||||
}).catch(function(request) {
|
||||
Log.error("Could not load data ... ", request);
|
||||
});
|
||||
})
|
||||
.finally(() => this.updateAvailable())
|
||||
},
|
||||
|
||||
fetchWeatherForecast() {
|
||||
@ -47,7 +48,8 @@ WeatherProvider.register("darksky", {
|
||||
this.setWeatherForecast(forecast);
|
||||
}).catch(function(request) {
|
||||
Log.error("Could not load data ... ", request);
|
||||
});
|
||||
})
|
||||
.finally(() => this.updateAvailable())
|
||||
},
|
||||
|
||||
// Create a URL from the config and base URL.
|
||||
|
@ -34,6 +34,7 @@ WeatherProvider.register("openweathermap", {
|
||||
.catch(function(request) {
|
||||
Log.error("Could not load data ... ", request);
|
||||
})
|
||||
.finally(() => this.updateAvailable())
|
||||
},
|
||||
|
||||
// Overwrite the fetchCurrentWeather method.
|
||||
@ -54,6 +55,7 @@ WeatherProvider.register("openweathermap", {
|
||||
.catch(function(request) {
|
||||
Log.error("Could not load data ... ", request);
|
||||
})
|
||||
.finally(() => this.updateAvailable())
|
||||
},
|
||||
|
||||
/** OpenWeatherMap Specific Methods - These are not part of the default provider methods */
|
||||
|
@ -41,6 +41,7 @@ WeatherProvider.register("ukmetoffice", {
|
||||
.catch(function(request) {
|
||||
Log.error("Could not load data ... ", request);
|
||||
})
|
||||
.finally(() => this.updateAvailable())
|
||||
},
|
||||
|
||||
// Overwrite the fetchCurrentWeather method.
|
||||
@ -62,6 +63,7 @@ WeatherProvider.register("ukmetoffice", {
|
||||
.catch(function(request) {
|
||||
Log.error("Could not load data ... ", request);
|
||||
})
|
||||
.finally(() => this.updateAvailable())
|
||||
},
|
||||
|
||||
|
||||
|
@ -35,6 +35,7 @@ WeatherProvider.register("weathergov", {
|
||||
.catch(function(request) {
|
||||
Log.error("Could not load data ... ", request);
|
||||
})
|
||||
.finally(() => this.updateAvailable())
|
||||
},
|
||||
|
||||
// Overwrite the fetchCurrentWeather method.
|
||||
@ -53,6 +54,7 @@ WeatherProvider.register("weathergov", {
|
||||
.catch(function(request) {
|
||||
Log.error("Could not load data ... ", request);
|
||||
})
|
||||
.finally(() => this.updateAvailable())
|
||||
},
|
||||
|
||||
/** Weather.gov Specific Methods - These are not part of the default provider methods */
|
||||
|
@ -79,16 +79,12 @@ var WeatherProvider = Class.extend({
|
||||
setCurrentWeather: function(currentWeatherObject) {
|
||||
// We should check here if we are passing a WeatherDay
|
||||
this.currentWeatherObject = currentWeatherObject;
|
||||
|
||||
this.updateAvailable();
|
||||
},
|
||||
|
||||
// Set the weatherForecastArray and notify the delegate that new information is available.
|
||||
setWeatherForecast: function(weatherForecastArray) {
|
||||
// We should check here if we are passing a WeatherDay
|
||||
this.weatherForecastArray = weatherForecastArray;
|
||||
|
||||
this.updateAvailable();
|
||||
},
|
||||
|
||||
// Set the fetched location name.
|
||||
|
Loading…
x
Reference in New Issue
Block a user