Talk:Location Object
The location.getModes() function lacks documentation. The SmartThings getModes() documentation suggests a return type of List<Mode>. Hubitat does not appear to have a Mode type; so, the following generates an error:
List<Mode> discoveredModes = location.getModes()
Through experimentation, it does look like location.getModes() returns a list of <id(string), name(string)> pairs; so, code like the following does work:
def discoveredModes = location.getModes()
paragraph "@0 id: ${discoveredModes[0].id} \tname: ${discoveredModes[0].name}"
paragraph "@1 id: ${discoveredModes[1].id} \tname: ${discoveredModes[1].name}"
paragraph "@2 id: ${discoveredModes[2].id} \tname: ${discoveredModes[2].name}"