}
}
+// These should have been global variables
+def heating
+def cooling
+
def windowChange(evt) {
- def heating = thermostats.findAll { it?.latestValue("thermostatMode") == "heat" }
- def cooling = thermostats.findAll { it?.latestValue("thermostatMode") == "cool" }
+ heating = thermostats.findAll { it?.latestValue("thermostatMode") == "heat" }
+ cooling = thermostats.findAll { it?.latestValue("thermostatMode") == "cool" }
if(heating || cooling) {
def open = sensors.findAll { it?.latestValue("contact") == "open" }