Mode Data Type

Well that’s how it works. A user sets a particular mode, and then my app adjusts the temperature settings based on the modes selected. The only thing is, I would like to be able to create an enum or a collection of some sort that I can add all available modes to and then subtract them after they are selected for an app setting – and have them be recognized as modes when they are used.

You can get the idea from this example although this example doesn’t work:

input “modes1”, title: “Modes”, type: “enum”, options: availableModes(), multiple: true
input “modes2”, title: “Modes”, type: “enum”, options: availableModes(), multiple: true

def availableModes()
{
def avaliableModesEnum = [ ]
location.modes.each {avaliableModesEnum << “$it”}

if (modes1) {
    avaliableModesEnum = avaliableModesEnum.minus(modes1)
}
if (modes2) {
    avaliableModesEnum = avaliableModesEnum.minus(modes2)
}

log.debug "availableModes(): avaliableModesEnum: ${avaliableModesEnum}"
return(avaliableModesEnum)
}

Here is the link to the thread containing my app, if that helps:

And GitHub:

But you really don’t need to go into that much detail. I just want to create a collection of modes from which each mode can only be selected once.