mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
weatherprovider
This commit is contained in:
parent
0fe79b5288
commit
63836185d9
@ -21,6 +21,7 @@ var WeatherProvider = Class.extend({
|
||||
// Try to not access them directly.
|
||||
currentWeatherObject: null,
|
||||
weatherForecastArray: null,
|
||||
fetchedLocationName: null,
|
||||
|
||||
// The following properties will be set automaticly.
|
||||
// You do not need to overwrite these properties.
|
||||
@ -71,6 +72,11 @@ var WeatherProvider = Class.extend({
|
||||
return this.weatherForecastArray
|
||||
},
|
||||
|
||||
// This returns the name of the fetched location or an empty string
|
||||
fetchedLocation: function() {
|
||||
return this.fetchedLocationName || ''
|
||||
},
|
||||
|
||||
// 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
|
||||
@ -87,6 +93,11 @@ var WeatherProvider = Class.extend({
|
||||
this.updateAvailable()
|
||||
},
|
||||
|
||||
// Set the fetched location name
|
||||
setFetchedLocation: function(name) {
|
||||
this.fetchedLocationName = name
|
||||
},
|
||||
|
||||
// Notify the delegate that new weather is available.
|
||||
updateAvailable: function() {
|
||||
this.delegate.updateAvailable(this)
|
||||
|
Loading…
x
Reference in New Issue
Block a user