From 1f675d721607f0f2c3fd4d21dbf1432eb11729da Mon Sep 17 00:00:00 2001 From: Rahmadi Trimananda Date: Fri, 26 Jul 2019 10:57:54 -0700 Subject: [PATCH] Update nfc-tag-toggle.groovy Code modifications to accommodate our model-checking infrastructure. --- official/nfc-tag-toggle.groovy | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/official/nfc-tag-toggle.groovy b/official/nfc-tag-toggle.groovy index 497be41..a637d30 100755 --- a/official/nfc-tag-toggle.groovy +++ b/official/nfc-tag-toggle.groovy @@ -49,13 +49,16 @@ def pageTwo() { "to determine whether to turn on or off the devices.") { if (switch1 || masterSwitch) { - input "masterSwitch", "enum", title: "Master switch", options: switch1.collect{[(it.id): it.displayName]}, required: false + //input "masterSwitch", "enum", title: "Master switch", options: switch1.collect{[(it.id): it.displayName]}, required: false + input "masterSwitch", "enum", title: "Master switch", options: switch1.collect{[(it.id)]}, required: false } if (lock || masterLock) { - input "masterLock", "enum", title: "Master lock", options: lock.collect{[(it.id): it.displayName]}, required: false + //input "masterLock", "enum", title: "Master lock", options: lock.collect{[(it.id): it.displayName]}, required: false + input "masterLock", "enum", title: "Master lock", options: lock.collect{[(it.id)]}, required: false } if (garageDoor || masterDoor) { - input "masterDoor", "enum", title: "Master door", options: garageDoor.collect{[(it.id): it.displayName]}, required: false + //input "masterDoor", "enum", title: "Master door", options: garageDoor.collect{[(it.id): it.displayName]}, required: false + input "masterDoor", "enum", title: "Master door", options: garageDoor.collect{[(it.id)]}, required: false } } section([mobileOnly:true]) { @@ -87,7 +90,8 @@ private currentStatus(devices, master, attribute) { log.trace "currentStatus($devices, $master, $attribute)" def result = null if (master) { - result = devices.find{it.id == master}?.currentValue(attribute) + //result = devices.find{it.id == master}?.currentValue(attribute) + result = devices.find{"[" + it.id + "]" == master}?.currentValue(attribute) } else { def map = [:] -- 2.34.1