Commenting out Verify APIs for app installation.
[smartthings-infrastructure.git] / WaterSensor / WaterSensors.groovy
index 184f2a081506d8e9ea4b6ca527a56a4829108e1d..bb8aac0ce22c906faf3cfc593c01765ee6d54a50 100644 (file)
@@ -22,20 +22,20 @@ public class WaterSensors {
                this.deviceNumbers = deviceNumbers
                this.waterSensors = []
 
-               def init = Verify.getBoolean()
+               /*def init = Verify.getBoolean()
                if (init) {
                        this.water = "dry"
                } else {
                        this.water = "wet"
-               }
+               }*/
                waterSensors.add(new WaterSensor(id, label, displayName, this.water))
        }
 
        //By Model Checker
        def setValue(LinkedHashMap eventDataMap) {
                if (eventDataMap["value"] != waterSensors[0].water) {
+                       this.water = eventDataMap["value"]
                        waterSensors[0].setValue(eventDataMap["value"])
-                       this.water = waterSensors[0].water
                        sendEvent(eventDataMap)
                }
        }
@@ -53,6 +53,9 @@ public class WaterSensors {
        def find(Closure Input) {
                waterSensors.find(Input)
        }
+       def sort(Closure Input) {
+               waterSensors.sort(Input)
+       }
        def collect(Closure Input) {
                waterSensors.collect(Input)
        }