I would like to add a Command in my driver's metadata section that has 3 input fields (i) cluster, (ii) attribute, and (ii) value. Fields (i) and (ii) are ENUM type and (iii) is a String.
I would like the choice for (i) to be based on a Map of values, and I would like the choices for (ii) to be based on what was chosen in field (i). The first of these is easy - I use some method to select and sort keys from a set of Map keys. I'm stuck on figuring out if (ii) is possible. In order to do this I would need to be able to access the first choice in a function called for the second set of constraings. That is, is there some way to write a function Map getAttributeConstraints( selected cluster from first choice)
command "test", [ [name:"cluster*", type:"ENUM", description:"Cluster to be Written To", constraints: (attributeInfo.keySet().collect{ "0x" + HexUtils.integerToHexString( it, 2) }) ],
[name:"attribute*", type:"ENUM", description:"Attribute to be Written To ${settings.cluster}", constraints: ( /* Can I put a function Here based on selected cluster */) ],
[name:"value", /* and this gets defined as a normal string field */]]