From a0ccf35eaa07224fa6c36c6260a4bba541dc6cdc Mon Sep 17 00:00:00 2001 From: Vinay Rao Date: Mon, 26 Sep 2016 14:17:36 -0700 Subject: [PATCH] SSVD-2897 to round celsius and fix rounding on fahrenheit --- .../smartsense-moisture-sensor.groovy | 4 ++-- .../smartsense-motion-sensor.groovy | 4 ++-- .../smartsense-multi-sensor.groovy | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/devicetypes/smartthings/smartsense-moisture-sensor.src/smartsense-moisture-sensor.groovy b/devicetypes/smartthings/smartsense-moisture-sensor.src/smartsense-moisture-sensor.groovy index 1cce229..d1b4623 100644 --- a/devicetypes/smartthings/smartsense-moisture-sensor.src/smartsense-moisture-sensor.groovy +++ b/devicetypes/smartthings/smartsense-moisture-sensor.src/smartsense-moisture-sensor.groovy @@ -180,9 +180,9 @@ private Map parseIasMessage(String description) { def getTemperature(value) { def celsius = Integer.parseInt(value, 16).shortValue() / 100 if(getTemperatureScale() == "C"){ - return celsius + return Math.round(celsius) } else { - return celsiusToFahrenheit(celsius) as Integer + return Math.round(celsiusToFahrenheit(celsius)) } } diff --git a/devicetypes/smartthings/smartsense-motion-sensor.src/smartsense-motion-sensor.groovy b/devicetypes/smartthings/smartsense-motion-sensor.src/smartsense-motion-sensor.groovy index d8f3e7a..3a8cbde 100644 --- a/devicetypes/smartthings/smartsense-motion-sensor.src/smartsense-motion-sensor.groovy +++ b/devicetypes/smartthings/smartsense-motion-sensor.src/smartsense-motion-sensor.groovy @@ -194,9 +194,9 @@ private Map parseIasMessage(String description) { def getTemperature(value) { def celsius = Integer.parseInt(value, 16).shortValue() / 100 if(getTemperatureScale() == "C"){ - return celsius + return Math.round(celsius) } else { - return celsiusToFahrenheit(celsius) as Integer + return Math.round(celsiusToFahrenheit(celsius)) } } diff --git a/devicetypes/smartthings/smartsense-multi-sensor.src/smartsense-multi-sensor.groovy b/devicetypes/smartthings/smartsense-multi-sensor.src/smartsense-multi-sensor.groovy index 36e081f..25c6591 100644 --- a/devicetypes/smartthings/smartsense-multi-sensor.src/smartsense-multi-sensor.groovy +++ b/devicetypes/smartthings/smartsense-multi-sensor.src/smartsense-multi-sensor.groovy @@ -261,9 +261,9 @@ def updated() { def getTemperature(value) { def celsius = Integer.parseInt(value, 16).shortValue() / 100 if(getTemperatureScale() == "C"){ - return celsius + return Math.round(celsius) } else { - return celsiusToFahrenheit(celsius) as Integer + return Math.round(celsiusToFahrenheit(celsius)) } }