Fix bug interpretting precipitation data from OpenWeatherMap
This commit is contained in:
@@ -239,7 +239,7 @@ function getOWMWeatherData( location, callback ) {
|
|||||||
weather.temp = parseInt( data.list[ 0 ].main.temp );
|
weather.temp = parseInt( data.list[ 0 ].main.temp );
|
||||||
weather.humidity = parseInt( data.list[ 0 ].main.humidity );
|
weather.humidity = parseInt( data.list[ 0 ].main.humidity );
|
||||||
weather.wind = parseInt( data.list[ 0 ].wind.speed );
|
weather.wind = parseInt( data.list[ 0 ].wind.speed );
|
||||||
weather.precip = data.list[ 0 ].rain ? parseFloat( data.list[ 0 ].rain[ "3h" ] ) : "";
|
weather.precip = data.list[ 0 ].rain ? parseFloat( data.list[ 0 ].rain[ "3h" ] || 0 ) : "";
|
||||||
|
|
||||||
location = location.join( "," );
|
location = location.join( "," );
|
||||||
|
|
||||||
@@ -434,6 +434,8 @@ exports.getWeather = function( req, res ) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log( weather );
|
||||||
|
|
||||||
var scale = calculateWeatherScale( adjustmentMethod, adjustmentOptions, weather ),
|
var scale = calculateWeatherScale( adjustmentMethod, adjustmentOptions, weather ),
|
||||||
rainDelay = -1;
|
rainDelay = -1;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user