mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 04:45:17 +00:00
Add a small forecast example.
This commit is contained in:
@@ -57,8 +57,8 @@ var WeatherProvider = Class.extend({
|
||||
|
||||
// This method should start the API request to fetch the weather forecast.
|
||||
// This method should definetly be overwritten in the provider.
|
||||
fetchWeatherForeCast: function() {
|
||||
Log.warn("Weather provider: " + this.providerName + " does not subclass the fetchWeatherForeCast method.")
|
||||
fetchWeatherForecast: function() {
|
||||
Log.warn("Weather provider: " + this.providerName + " does not subclass the fetchWeatherForecast method.")
|
||||
},
|
||||
|
||||
// This returns a WeatherDay object for the current weather.
|
||||
@@ -71,7 +71,7 @@ var WeatherProvider = Class.extend({
|
||||
return this.weatherForecastArray
|
||||
},
|
||||
|
||||
// Set the currentWeather and notify the delegate that new information is availabe.
|
||||
// Set the currentWeather and notify the delegate that new information is available.
|
||||
setCurrentWeather: function(currentWeatherObject) {
|
||||
// We should check here if we are passing a WeatherDay
|
||||
this.currentWeatherObject = currentWeatherObject
|
||||
@@ -79,6 +79,14 @@ var WeatherProvider = Class.extend({
|
||||
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()
|
||||
},
|
||||
|
||||
// Notify the delegate that new weather is available.
|
||||
updateAvailable: function() {
|
||||
this.delegate.updateAvailable(this)
|
||||
|
Reference in New Issue
Block a user