mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-07-10 17:24:44 +00:00
Update fork
This commit is contained in:
parent
7be6031e19
commit
837e275bfd
@ -30,9 +30,23 @@ WeatherProvider.register("darksky", {
|
||||
Log.error("Could not load data!", request);
|
||||
});
|
||||
},
|
||||
fetchWeatherForecast: function() {
|
||||
// Also, fake data.
|
||||
var forecast = [];
|
||||
var today = moment();
|
||||
for(var i = 0; i < 5; i++) {
|
||||
var weatherObject = new WeatherObject();
|
||||
weatherObject.date = moment(today).add(i, "days");
|
||||
weatherObject.minTemperature = Math.random() * 10 + 10;
|
||||
weatherObject.maxTemperature = Math.random() * 15 + 10;
|
||||
forecast.push(weatherObject);
|
||||
}
|
||||
this.setWeatherForecast();
|
||||
},
|
||||
// Implement WeatherDay generator.
|
||||
generateWeatherDayFromCurrentWeather: function(currentWeatherData) {
|
||||
var currentWeather = new WeatherDay();
|
||||
var currentWeather = new WeatherObject();
|
||||
currentWeather.date = new Date();
|
||||
currentWeather.humidity = parseFloat(currentWeatherData.currently.humidity);
|
||||
currentWeather.temperature = parseFloat(currentWeatherData.currently.temperature);
|
||||
currentWeather.windSpeed = parseFloat(currentWeatherData.currently.windSpeed);
|
||||
|
Loading…
x
Reference in New Issue
Block a user