def lock() {
if (lockState != "locked") {
println("the door with id:$id is locked!")
- this.lockLatestValue = this.lockState
+ //this.lockLatestValue = this.lockState
+ this.lockLatestValue = "locked"
this.lockState = "locked"
this.currentLock = "locked"
sendEvent([name: "lock", value: "locked", deviceId: this.id, descriptionText: "",
if (lockState != "locked") {
def task = timers.runAfter(metaData["delay"]) {
println("the door with id:$id is locked!")
- this.lockLatestValue = this.lockState
+ //this.lockLatestValue = this.lockState
+ this.lockLatestValue = "locked"
this.lockState = "locked"
this.currentLock = "locked"
sendEvent([name: "lock", value: "locked", deviceId: this.id, descriptionText: "",
def unlock() {
if (lockState != "unlocked") {
println("the door with id:$id is unlocked!")
- this.lockLatestValue = this.lockState
+ //this.lockLatestValue = this.lockState
+ this.lockLatestValue = "unlocked"
this.lockState = "unlocked"
this.currentLock = "unlocked"
sendEvent([name: "unlock", value: "unlocked", deviceId: this.id, descriptionText: "",
if (lockState != "unlocked") {
def task = timers.runAfter(metaData["delay"]) {
println("the door with id:$id is locked!")
- this.lockLatestValue = this.lockState
+ //this.lockLatestValue = this.lockState
+ this.lockLatestValue = "locked"
this.lockState = "locked"
this.currentLock = "locked"
sendEvent([name: "unlock", value: "unlocked", deviceId: this.id, descriptionText: "",