AttributeError: 'NoneType' object has no attribute 'updateStateOnServer'
this is what I have.... but it's basically identical (except for swapping out keys and stuff) to other lines that are working just fine... (Line 47 is the 3rd line down)
- Code: Select all
def setUserLocation(self, pluginAction, dev):
substitutedTitle = self.substitute(pluginAction.props.get("userLocationField", ""))
dev.updateStateOnServer(key="userLocation", value=substitutedTitle)
self.debugLog("Set User Location: " + str(pluginAction.props.get(u"userLocationField")) + " Entered. State userLocation set to: " + substitutedTitle)
- Code: Select all
<State id="userLocation">
<ValueType>String</ValueType>
<TriggerLabel>User Location</TriggerLabel>
<ControlPageLabel>User Location</ControlPageLabel>
</State>
- Code: Select all
<Action id="setUserLocation">
<Name>Set User Location</Name>
<CallbackMethod>setUserLocation</CallbackMethod>
<ConfigUI>
<Field type="textfield" id="userLocationField">
<Label>User Location:</Label>
</Field>
</ConfigUI>
</Action>
And this one, for example, works just fine with a string, varID or device state entered.
- Code: Select all
def setUserIDNumber(self, pluginAction, dev): #<- Substitute Test
substitutedTitle = self.substitute(pluginAction.props.get("userIDNumberField", ""))
dev.updateStateOnServer(key="userIDNumber", value=substitutedTitle)
self.debugLog("Set User ID: " + str(pluginAction.props.get(u"userIDNumberField")) + " Entered. " + "State userIDNumber set to: " + substitutedTitle)