1) kStateImageSel.Sensor....
- My device id="homeState" with list options "Home" "Away" and "Unsure"
My Actions has a plugin action that sets with either "Home", "Away" or "Unsure"
My plugin.py is correctly updating "homeState", but the image isn't cooperating. "Away" = grey dot (good), "Unsure" = red dot (good), "Home" = red dot (bad)
- Code: Select all
def setHomeState(self, pluginAction, dev):
self.debugLog(u"setHomestate Action called:\n" + str(pluginAction))
dev.updateStateOnServer(key="homeState", value=str(pluginAction.props.get(u"homeStateField")))
HomeStateValue = str(pluginAction.props.get(u"homeStateField"))
if HomeStateValue == "Home":
dev.updateStateImageOnServer(indigo.kStateImageSel.SensorOn)
if HomeStateValue == "Away":
dev.updateStateImageOnServer(indigo.kStateImageSel.SensorOff)
else:
dev.updateStateImageOnServer(indigo.kStateImageSel.SensorTripped)
2) Address UI
- I use two states for address which are mirrored, email1address and address.
The plugin action correctly updates both states with the entered text string
The uiValue remains at " - none - "
- Code: Select all
def setEmail1Address(self, pluginAction, dev):
self.debugLog(u"setEmail1Address Action called:\n" + str(pluginAction))
addressVar = str(pluginAction.props.get(u"email1AddressField"))
dev.updateStateOnServer(key="email1Address", value=addressVar)
# dev.updateStateOnServer(key="address", value=addressVar)
dev.updateStateOnServer("address",addressVar, uiValue=addressVar)
# dev.updateStateOnServer("address","A Thing", uiValue="Another Thing")
Any pointers would be appreciated. (This is my first plugin attempt and it's been brutal).