Merge branch 'master' of ssh://plrg.eecs.uci.edu/home/git/smartthings-infrastructure
[smartthings-infrastructure.git] / Lock / Lock.groovy
index 0271050af9dd100f9bedc0c430caa4fe3ea8a765..4b84497003b6696d86c74eacdcc6567f32766919 100644 (file)
@@ -28,6 +28,10 @@ public class Lock {
        def lock() {
                if (lockState != "locked") {
                        println("the door with id:$id is locked!")
+<<<<<<< HEAD
+=======
+                       //this.lockLatestValue = this.lockState
+>>>>>>> a02c9807815a35c0f57241ee6510a3d312499049
                        this.lockLatestValue = "locked"
                        this.lockState = "locked"
                        this.currentLock = "locked"
@@ -42,6 +46,10 @@ public class Lock {
                if (lockState != "locked") {
                        def task = timers.runAfter(metaData["delay"]) {
                                println("the door with id:$id is locked!")
+<<<<<<< HEAD
+=======
+                               //this.lockLatestValue = this.lockState
+>>>>>>> a02c9807815a35c0f57241ee6510a3d312499049
                                this.lockLatestValue = "locked"
                                this.lockState = "locked"
                                this.currentLock = "locked"
@@ -56,6 +64,10 @@ public class Lock {
        def unlock() {
                if (lockState != "unlocked") {
                        println("the door with id:$id is unlocked!")
+<<<<<<< HEAD
+=======
+                       //this.lockLatestValue = this.lockState
+>>>>>>> a02c9807815a35c0f57241ee6510a3d312499049
                        this.lockLatestValue = "unlocked"
                        this.lockState = "unlocked"
                        this.currentLock = "unlocked"
@@ -63,8 +75,11 @@ public class Lock {
                                  displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
                        sendEvent([name: "lock", value: "unlocked", deviceId: this.id, descriptionText: "",
                                  displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
+<<<<<<< HEAD
                        sendEvent([name: "lock.unlocked", value: "unlocked", deviceId: this.id, descriptionText: "",
                                  displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
+=======
+>>>>>>> a02c9807815a35c0f57241ee6510a3d312499049
                }
        }
 
@@ -72,6 +87,7 @@ public class Lock {
                if (lockState != "unlocked") {
                        def task = timers.runAfter(metaData["delay"]) {
                                println("the door with id:$id is locked!")
+<<<<<<< HEAD
                                this.lockLatestValue = "unlocked"
                                this.lockState = "unlocked"
                                this.currentLock = "unlocked"
@@ -81,6 +97,16 @@ public class Lock {
                                          displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
                                sendEvent([name: "lock.unlocked", value: "unlocked", deviceId: this.id, descriptionText: "",
                                          displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])                             
+=======
+                               //this.lockLatestValue = this.lockState
+                               this.lockLatestValue = "locked"
+                               this.lockState = "locked"
+                               this.currentLock = "locked"
+                               sendEvent([name: "unlock", value: "unlocked", deviceId: this.id, descriptionText: "",
+                                         displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
+                               sendEvent([name: "lock", value: "unlocked", deviceId: this.id, descriptionText: "",
+                                               displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
+>>>>>>> a02c9807815a35c0f57241ee6510a3d312499049
                        }
                }
        }