mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-08 05:31:56 +00:00
Merge pull request #1297 from workingmonk/feature/temp_rounding
SSVD-2897 to round celsius and fix rounding on fahrenheit
This commit is contained in:
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user