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: "",
//By Apps
def lock() {
if (lockState != "locked") {
- lockLatestValue = lockState
+ //lockLatestValue = lockState
+ lockLatestValue = "locked"
lockState = "locked"
currentLock = "locked"
locks[0].lock()
def lock(LinkedHashMap metaData) {
if (lockState != "locked") {
def task = timers.runAfter(metaData["delay"]) {
- lockLatestValue = lockState
+ //lockLatestValue = lockState
+ lockLatestValue = "locked"
lockState = "locked"
currentLock = "locked"
locks[0].lock()
def unlock() {
if (lockState != "unlocked") {
- lockLatestValue = lockState
+ //lockLatestValue = lockState
+ lockLatestValue = "unlocked"
lockState = "unlocked"
currentLock = "unlocked"
locks[0].unlock()
def unlock(LinkedHashMap metaData) {
if (lockState != "unlocked") {
def task = timers.runAfter(metaData["delay"]) {
- lockLatestValue = lockState
+ //lockLatestValue = lockState
+ lockLatestValue = "unlocked"
lockState = "unlocked"
currentLock = "unlocked"
locks[0].unlock()