X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=official%2Fnfc-tag-toggle.groovy;h=a637d303cb113f1936562b6890a57b3d2842f049;hb=b9cac78d82734f4b909691ea1a3e086eb7697ef5;hp=497be4134d1d9d6286a836019e8b0e6c897c801f;hpb=3325c1b0cc49b9fbbc497cb3612f7aeff5263eca;p=smartapps.git 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 = [:]