matt (support) wrote:... What you want to do is something like this:
- Code: Select all
def getDeviceStateList(self, dev):
stateList = indigo.PluginBase.getDeviceStateList(self, dev)
if stateList is not None:
# Add any dynamic states onto the device based on the node's characteristics.
if dev-supports-something:
someNumState = self.getDeviceStateDictForNumberType(u"someNumState", u"Some Level Label", u"Some Level Label")
someStringState = self.getDeviceStateDictForStringType(u"someStringState", u"Some Level Label", u"Some Level Label")
someOnOffBoolState = self.getDeviceStateDictForBoolOnOffType(u"someOnOffBoolState", u"Some Level Label", u"Some Level Label")
someYesNoBoolState = self.getDeviceStateDictForBoolYesNoType(u"someYesNoBoolState", u"Some Level Label", u"Some Level Label")
someOneZeroBoolState = self.getDeviceStateDictForBoolOneZeroType(u"someOneZeroBoolState", u"Some Level Label", u"Some Level Label")
someTrueFalseBoolState = self.getDeviceStateDictForBoolTrueFalseType(u"someTrueFalseBoolState", u"Some Level Label", u"Some Level Label")
stateList.append(someNumState)
stateList.append(someStringState)
stateList.append(someOnOffBoolState)
stateList.append(someYesNoBoolState)
stateList.append(someOneZeroBoolState)
stateList.append(someTrueFalseBoolState)
return stateList
With Indigo 7.5, I am looking fora self.getDeviceStateDictForFloatType but trying that doesn't seem to work?
Can it be added or is there another way to force this?