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"
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"
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"
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
}
}
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"
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
}
}
}
this.deviceNumbers = deviceNumbers
this.smokeDetectors = []
-<<<<<<< HEAD
- def initBattery = Verify.getIntFromList(30, 50, 70)
- this.battery = initBattery
- this.batteryLatestValue = initBattery
-
- def initSmoke = Verify.getInt(0,2)
- if (initSmoke == 0) {
-=======
/*def init = Verify.getInt(0,2)
if (init == 0) {
->>>>>>> a02c9807815a35c0f57241ee6510a3d312499049
this.currentSmokeValue = "clear"
this.smokeLatestValue = "clear"
} else if (initSmoke == 1) {
} else {
this.currentSmokeValue = "tested"
this.smokeLatestValue = "tested"
-<<<<<<< HEAD
}
def initCarbonMonoxide = Verify.getInt(0,2)
this.currentCarbonMonoxideValue = "tested"
this.carbonMonoxideLatestValue = "tested"
}
- smokeDetectors.add(new SmokeDetector(id, label, displayName, this.currentSmokeValue, this.smokeLatestValue, this.currentCarbonMonoxideValue,
- this.carbonMonoxideLatestValue, this.battery))
-=======
}*/
smokeDetectors.add(new SmokeDetector(id, label, displayName, this.currentSmokeValue, this.smokeLatestValue))
->>>>>>> a02c9807815a35c0f57241ee6510a3d312499049
}
//By Model Checker