Commit #10: more classes
[smartthings-infrastructure.git] / PresenceSensor / PresenceSensors.groovy
index 8fb9161864606b45652e74ecf7a542a828760ace..2408a5aa5c726535b7efd4bc5267bc600b8545a3 100644 (file)
@@ -11,7 +11,7 @@ public class PresenceSensors {
        private String id = "presenceSensorID0"
        private String label = "presenceSensor0"
        private String displayName = "presenceSensor0"
-       private String presenceState = "not present"
+       private String presence = "not present"
        private String currentPresence = "not present"
        private String presenceLatestValue = "not present"
 
@@ -21,16 +21,16 @@ public class PresenceSensors {
                this.deviceNumbers = deviceNumbers
                this.presenceSensors = []
 
-               presenceSensors.add(new PresenceSensor(id, label, displayName, this.presenceState, this.presenceLatestValue))
+               presenceSensors.add(new PresenceSensor(id, label, displayName, this.presence, this.presenceLatestValue))
        }
 
        //By Model Checker
        def setValue(LinkedHashMap eventDataMap) {
-               if (eventDataMap["value"] != presenceSensors[0].presenceState) {
+               if (eventDataMap["value"] != presenceSensors[0].presence) {
                        presenceSensors[0].setValue(eventDataMap["value"])
                        this.presenceLatestValue = presenceSensors[0].presenceLatestValue
-                       this.presenceState = presenceSensors[0].presenceState
-                       this.currentPresence = presenceSensors[0].presenceState
+                       this.presence = presenceSensors[0].presence
+                       this.currentPresence = presenceSensors[0].presence
                        sendEvent(eventDataMap)
                }
        }