Update thermostat.groovy
authorRahmadi Trimananda <rahmadi.trimananda@uci.edu>
Fri, 16 Aug 2019 22:44:38 +0000 (15:44 -0700)
committerGitHub Enterprise <noreply@github.uci.edu>
Fri, 16 Aug 2019 22:44:38 +0000 (15:44 -0700)
official/thermostat.groovy

index 88dd566..88501dd 100644 (file)
@@ -76,13 +76,13 @@ def updated() {
 }
 
 def subscribeToEvents() {
-       subscribe(smokeDevices, "smoke.detected", eventHandler1)
-       subscribe(smokeDevices, "smoke.tested", eventHandler1)
-       subscribe(smokeDevices, "carbonMonoxide.detected", eventHandler1)
-       subscribe(carbonMonoxideDevices, "carbonMonoxide.detected", eventHandler1)
+       subscribe(smokeDevices, "smoke.detected", eventHandler)
+       subscribe(smokeDevices, "smoke.tested", eventHandler)
+       subscribe(smokeDevices, "carbonMonoxide.detected", eventHandler)
+       subscribe(carbonMonoxideDevices, "carbonMonoxide.detected", eventHandler)
 }
 
-def eventHandler1(evt) {
+def eventHandler(evt) {
        log.debug "Notify got evt ${evt}"
        // Turn off thermostat
        thermostatDevices*.setThermostatMode("off")