Changing remote branch to PLRG Git server.
[smartapps.git] / official / thermostat.groovy
index 88501dda2631320ddd304ba28d2cd3b075d2a46b..058a66b2438c0ed6fc5adbbedb6762504a031ad5 100644 (file)
@@ -76,16 +76,16 @@ def updated() {
 }
 
 def subscribeToEvents() {
-       subscribe(smokeDevices, "smoke.detected", eventHandler)
-       subscribe(smokeDevices, "smoke.tested", eventHandler)
-       subscribe(smokeDevices, "carbonMonoxide.detected", eventHandler)
-       subscribe(carbonMonoxideDevices, "carbonMonoxide.detected", eventHandler)
+       subscribe(smokeDevices, "smoke.detected", eventHandler1)
+       subscribe(smokeDevices, "smoke.tested", eventHandler1)
+       subscribe(smokeDevices, "carbonMonoxide.detected", eventHandler1)
+       subscribe(carbonMonoxideDevices, "carbonMonoxide.detected", eventHandler1)
 }
 
-def eventHandler(evt) {
+def eventHandler1(evt) {
        log.debug "Notify got evt ${evt}"
        // Turn off thermostat
-       thermostatDevices*.setThermostatMode("off")
+       thermostatDevices.setThermostatMode("off")
        if (frequency) {
                def lastTime = state[evt.deviceId]
                if (lastTime == null || now() - lastTime >= frequency * 60000) {