Begin refactoring to TypeScript
This commit is contained in:
4
routes/weather.js → routes/weather.ts
Executable file → Normal file
4
routes/weather.js → routes/weather.ts
Executable file → Normal file
@@ -192,7 +192,7 @@ function calculateWeatherScale( adjustmentMethod, adjustmentOptions, weather ) {
|
||||
}
|
||||
|
||||
// Apply all of the weather modifying factors and clamp the result between 0 and 200%.
|
||||
return parseInt( Math.min( Math.max( 0, 100 + humidityFactor + tempFactor + precipFactor ), 200 ) );
|
||||
return Math.floor( Math.min( Math.max( 0, 100 + humidityFactor + tempFactor + precipFactor ), 200 ) );
|
||||
}
|
||||
|
||||
return -1;
|
||||
@@ -305,7 +305,7 @@ exports.getWateringData = function( req, res ) {
|
||||
var data = {
|
||||
scale: scale,
|
||||
rd: rainDelay,
|
||||
tz: getTimezone( weather.timezone ),
|
||||
tz: getTimezone( weather.timezone, undefined ),
|
||||
sunrise: weather.sunrise,
|
||||
sunset: weather.sunset,
|
||||
eip: ipToInt( remoteAddress ),
|
||||
Reference in New Issue
Block a user