<Field
id="thing1"
type="menu"
defaultValue="None">
<Label>Thing 1:</Label>
<List
class="self"
filter=""
method="listGenerator"
dynamicReload="true"/>
</Field>
def listGenerator(self, filter="", valuesDict=None, typeId="", targetId=0):
# This method collects IDs and names for all Indigo devices and
# variables. It creates a dictionary of the form
# ((dev.id, dev.name), (var.id, var.name)).
self.debugLog(u"listGenerator() method called.")
dev_list = [(dev.id, "(D) %s" % dev.name) for dev in indigo.devices]
var_list = [(var.id, "(V) %s" % var.name) for var in indigo.variables]
List = dev_list + var_list
List.append(('None', 'None'))
self.debugLog(u"Generated list of devices and variables:")
self.debugLog(unicode(List))
return List
Users browsing this forum: No registered users and 3 guests