I'm a newbie in Groovy (and in HE, as a matter of facts) and I'm developing my first Hubitat app/driver and I'm facing some unexpected difficulties ...
Forgive me if I'm wrong, but so far I've learned that some statements available in Groovy are not available in HE Groovy, e.g., the enum statement. I don't like to use literals anywhere in my codings, so, the absence of the enum statement is bugging me.
Are you just trying to match numeric keys to their string/"friendly name" values? If so, you could try something like this towards the top of your script (after any imports--one more of which you'll have to include as below--but before metadata is the usual spot):
to go back to 2 (here theNumber) or, of course, something like myMap[2] to get 'Unlocking'. I'm not sure what your actual use is for this, but maybe this would work?
Additionally, it solved my problem of using it throughout my code. I've tested it using the "state" variable, but it was no good, since it was shown on the UI - not and info that is relevant for the user, no? NTKB always !