Average the min/max temp for current temp (instead of using day value)

This commit is contained in:
Samer Albahra
2019-04-10 01:32:25 +03:00
parent 0145ee4bef
commit e92be3a001

View File

@@ -65,9 +65,9 @@ function getOWMWeatherData( location, callback ) {
weather.region = data.city.country;
weather.city = data.city.name;
weather.temp = parseInt( data.list[ 0 ].temp.day );
weather.minTemp = parseInt( data.list[ 0 ].temp.min );
weather.maxTemp = parseInt( data.list[ 0 ].temp.max );
weather.temp = ( weather.minTemp + weather.maxTemp ) / 2;
weather.humidity = parseInt( data.list[ 0 ].humidity );
weather.wind = parseInt( data.list[ 0 ].speed );
weather.precip = ( data.list[ 0 ].rain ? parseFloat( data.list[ 0 ].rain || 0 ) : 0 ) / 25.4;