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 285fe53..fd18e43 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"}'])
                        }
                }
        }