For instance:
- Code: Select all
# THIS FIELD IN DEVICES.XML:
<Field type="menu" id="customList">
<Label>Custom List:</Label>
<List class="self" filter="" method="getCustomList" dynamicReload="true"/>
</Field>
# CALLS THIS FUNCTION IN PLUGIN.PY:
def getCustomList(filter, valuesDict, typeId, targetId):
ret = [("default", "No items found")]
try:
listRet = []
# Loop over options
listRet.append((0, "First Option"))
listRet.append((1, "Second Option"))
# Return custom list to Indigo
return listRet
except:
return ret
I want to be able to return that list and say "defaultValue = 1" along with it.