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.
|
// Try to not access them directly.
|
||||||
currentWeatherObject: null,
|
currentWeatherObject: null,
|
||||||
weatherForecastArray: null,
|
weatherForecastArray: null,
|
||||||
|
fetchedLocationName: null,
|
||||||
|
|
||||||
// The following properties will be set automaticly.
|
// The following properties will be set automaticly.
|
||||||
// You do not need to overwrite these properties.
|
// You do not need to overwrite these properties.
|
||||||
@ -71,6 +72,11 @@ var WeatherProvider = Class.extend({
|
|||||||
return this.weatherForecastArray
|
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.
|
// Set the currentWeather and notify the delegate that new information is available.
|
||||||
setCurrentWeather: function(currentWeatherObject) {
|
setCurrentWeather: function(currentWeatherObject) {
|
||||||
// We should check here if we are passing a WeatherDay
|
// We should check here if we are passing a WeatherDay
|
||||||
@ -87,6 +93,11 @@ var WeatherProvider = Class.extend({
|
|||||||
this.updateAvailable()
|
this.updateAvailable()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Set the fetched location name
|
||||||
|
setFetchedLocation: function(name) {
|
||||||
|
this.fetchedLocationName = name
|
||||||
|
},
|
||||||
|
|
||||||
// Notify the delegate that new weather is available.
|
// Notify the delegate that new weather is available.
|
||||||
updateAvailable: function() {
|
updateAvailable: function() {
|
||||||
this.delegate.updateAvailable(this)
|
this.delegate.updateAvailable(this)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user