Updated math to use Math.round to help get better values. Updated code

for determining if Vera is available so as to not show those screens.
Updated file handling as there were issues due to no checks for file
handling, this will improve for windows.
This commit is contained in:
Admin
2015-10-13 16:30:45 -05:00
parent c5fbd5d1f0
commit 7c1d6e40b8
7 changed files with 33 additions and 20 deletions

View File

@@ -257,7 +257,7 @@ public class HueMulator {
log.debug("Math eval is: " + mathDescriptor + ", Where " + INTENSITY_MATH_VALUE + " is: " + String.valueOf(intensity));
Expression exp = new Expression(mathDescriptor);
BigDecimal result = exp.eval(variables);
Integer endResult = result.intValue();
Integer endResult = Math.round(result.floatValue());
request = request.replace(INTENSITY_MATH + mathDescriptor + INTENSITY_MATH_CLOSE, endResult.toString());
} catch (Exception e) {
log.error("Could not execute Math: " + mathDescriptor, e);