I wish to use a list to select the description of a sensor function. I guess I could use a Map but now that I've started using the List form I'm determined to figure out how to use it.
Can anyone see where I've gone astray?
App Code section defining lists
// =====================================================
//Needed for lists to be available in methods
@Field static List<String> DescList = ['Outside Temp = ', 'Outside Humidity = ', 'Outside Dew Point = ','Pressure = ','Inside Temp = ', 'Inside Humidity = ', 'Alarm Status: ']
@Field static List<String> UnitsList = [ ' °F', ' %RH',' °F','hPa',' °F',' %RH']
// ______________________________________________________
def installed() {
initialize()
}
Section of code where I'm trying to select a member of the list
int index = 1
log.info "DescList 1 = $DescList[index]" // same result with $DescList(index)
Log Error