I have the plugin working with multiple devices, each with their own custom states. Thanks for the pointers. For simplicity in the initial rounds, I decided to string everything. This works great:
- Code: Select all
def getDeviceStateList(self, dev):
stateList = indigo.PluginBase.getDeviceStateList(self, dev)
if stateList is not None:
for key in self.xmlDict.iterkeys():
dynamicState1 = self.getDeviceStateDictForStringType(key, key, key)
stateList.append(dynamicState1)
return stateList
However, for Trigger and Control Page UI stuff, Indigo reaches out again to
getDeviceStateList() just as you said it would, and there's the rub. It returns the last stateList generated--not necessarily the one appropriate to dev. For example, I have three plugin devices (A, B, and C). When I create a trigger for device A, I get the trigger labels for device C.
Am I missing something obvious?