From 6e0a38ada3c1b315db06b0fa78d98909162ca89c Mon Sep 17 00:00:00 2001 From: Matthew Oslan Date: Sun, 5 May 2019 19:09:29 -0400 Subject: [PATCH] Improve raw data returned by watering level calculation --- routes/weather.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/routes/weather.js b/routes/weather.js index 64c6dbd..be6aeee 100755 --- a/routes/weather.js +++ b/routes/weather.js @@ -309,7 +309,12 @@ exports.getWateringData = function( req, res ) { sunrise: weather.sunrise, sunset: weather.sunset, 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