alterSetpoint - check for auto or off mode

changed debug message
This commit is contained in:
James Chen
2016-10-06 15:44:16 -07:00
parent 427fa88ed8
commit 12b09acfa8

View File

@@ -655,6 +655,10 @@ void lowerSetpoint() {
void alterSetpoint(temp) { void alterSetpoint(temp) {
def mode = device.currentValue("thermostatMode") def mode = device.currentValue("thermostatMode")
if (mode == "off" || mode == "auto") {
log.warn "this mode: $mode does not allow alterSetpoint"
} else {
def heatingSetpoint = device.currentValue("heatingSetpoint") def heatingSetpoint = device.currentValue("heatingSetpoint")
def coolingSetpoint = device.currentValue("coolingSetpoint") def coolingSetpoint = device.currentValue("coolingSetpoint")
def deviceId = device.deviceNetworkId.split(/\./).last() def deviceId = device.deviceNetworkId.split(/\./).last()
@@ -705,6 +709,7 @@ void alterSetpoint(temp) {
} }
generateStatusEvent() generateStatusEvent()
} }
}
def generateStatusEvent() { def generateStatusEvent() {