INTL-527 Temperature Notifications Should Respect Location Temp Scale

This commit is contained in:
chelseaokey
2016-05-18 16:46:17 -05:00
parent 40e6778e31
commit 85a335d365
2 changed files with 4 additions and 2 deletions

View File

@@ -73,7 +73,8 @@ def temperatureHandler(evt) {
// TODO: Send "Temperature back to normal" SMS, turn switch off
} else {
log.debug "Temperature dropped below $tooCold: sending SMS to $phone1 and activating $mySwitch"
send("${temperatureSensor1.displayName} is too cold, reporting a temperature of ${evt.value}${evt.unit?:"F"}")
def tempScale = location.temperatureScale ?: "F"
send("${temperatureSensor1.displayName} is too cold, reporting a temperature of ${evt.value}${evt.unit?:tempScale}")
switch1?.on()
}
}

View File

@@ -73,7 +73,8 @@ def temperatureHandler(evt) {
// TODO: Send "Temperature back to normal" SMS, turn switch off
} else {
log.debug "Temperature rose above $tooHot: sending SMS to $phone1 and activating $mySwitch"
send("${temperatureSensor1.displayName} is too hot, reporting a temperature of ${evt.value}${evt.unit?:"F"}")
def tempScale = location.temperatureScale ?: "F"
send("${temperatureSensor1.displayName} is too hot, reporting a temperature of ${evt.value}${evt.unit?:tempScale}")
switch1?.on()
}
}