- if (lockState != "unlocked") {
- def task = timers.runAfter(metaData["delay"]) {
- //lockLatestValue = lockState
- lockLatestValue = "unlocked"
- lockState = "unlocked"
- currentLock = "unlocked"
- locks[0].unlock()
- }
- }
- }
-
- //Methods for closures
- def count(Closure Input) {
- locks.count(Input)
- }
- def size() {
- locks.size()
- }
- def each(Closure Input) {
- locks.each(Input)
- }
- def find(Closure Input) {
- locks.find(Input)
- }
- def sort(Closure Input) {
- locks.sort(Input)
- }
- def collect(Closure Input) {
- locks.collect(Input)
- }
-
- //By Model Checker
- def setValue(LinkedHashMap eventDataMap) {
- if (eventDataMap["value"] != locks[0].lockState) {
- locks[0].setValue(eventDataMap["value"])
- this.lockState = locks[0].lockState
- this.currentLock = locks[0].lockState
- this.lockLatestValue = locks[0].lockLatestValue
- sendEvent(eventDataMap)
- }
- }
-
- def currentValue(String deviceFeature) {
- locks[0].currentValue(deviceFeature)
- }
-
- def latestValue(String deviceFeature) {
- locks[0].latestValue(deviceFeature)