Merge branch 'master' of ssh://plrg.eecs.uci.edu/home/git/smartthings-infrastructure
[smartthings-infrastructure.git] / BeaconSensor / BeaconSensors.groovy
index b2b5e1a8379ab3d32ffdef4a29f219fe830f1a84..0e9996f89fde3e8e42b785deb42bc0ece00df485 100644 (file)
@@ -38,10 +38,10 @@ public class BeaconSensors {
        //By Model Checker
        def setValue(LinkedHashMap eventDataMap) {
                if (eventDataMap["value"] != beaconSensors[0].presence) {
+                       this.presenceLatestValue = eventDataMap["value"]
+                       this.presence = eventDataMap["value"]
+                       this.currentPresence = eventDataMap["value"]
                        beaconSensors[0].setValue(eventDataMap["value"])
-                       this.presenceLatestValue = beaconSensors[0].presenceLatestValue
-                       this.presence = beaconSensors[0].presence
-                       this.currentPresence = beaconSensors[0].presence
                        sendEvent(eventDataMap)
                }
        }
@@ -56,6 +56,9 @@ public class BeaconSensors {
        def each(Closure Input) {
                beaconSensors.each(Input)
        }
+       def sort(Closure Input) {
+               beaconSensors.sort(Input)
+       }
        def find(Closure Input) {
                beaconSensors.find(Input)
        }