Adding 2 types of 'unlocked' events both for subscribers to 'lock' and 'unlock' events.
authorrtrimana <rtrimana@uci.edu>
Wed, 31 Jul 2019 22:47:58 +0000 (15:47 -0700)
committerrtrimana <rtrimana@uci.edu>
Wed, 31 Jul 2019 22:47:58 +0000 (15:47 -0700)
Lock/Lock.groovy

index 285fe53217dadf8514de4f32ecb8f60bd5a6afc6..fd18e4384071a7de01191dcdaad67ad3fcc9331b 100644 (file)
@@ -60,6 +60,8 @@ public class Lock {
                        this.currentLock = "unlocked"
                        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"}'])
                }
        }
 
@@ -73,6 +75,8 @@ public class Lock {
                                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"}'])
                        }
                }
        }