From e92be3a00170e189e9a740689e04e1f7aa71c0f3 Mon Sep 17 00:00:00 2001 From: Samer Albahra Date: Wed, 10 Apr 2019 01:32:25 +0300 Subject: [PATCH] Average the min/max temp for current temp (instead of using day value) --- routes/weather.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/weather.js b/routes/weather.js index 91ea7a9..598ee89 100755 --- a/routes/weather.js +++ b/routes/weather.js @@ -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;