Improve raw data returned by watering level calculation

This commit is contained in:
Matthew Oslan
2019-05-05 19:09:29 -04:00
parent c5b66d02a0
commit 6e0a38ada3

View File

@@ -309,7 +309,12 @@ exports.getWateringData = function( req, res ) {
sunrise: weather.sunrise, sunrise: weather.sunrise,
sunset: weather.sunset, sunset: weather.sunset,
eip: ipToInt( remoteAddress ), eip: ipToInt( remoteAddress ),
rawData: { h: weather.humidity, p: weather.precip, t: weather.temp } rawData: {
h: weather.humidity,
p: Math.round( weather.precip * 100 ) / 100,
t: Math.round( weather.temp * 10 ) / 10,
raining: weather.raining ? 1 : 0
}
}; };
// Return the response to the client in the requested format // Return the response to the client in the requested format