nlagaros wrote:Jay/Matt - is there anything I can do to expose the device name? I'm not sure it is possible, but please advise.
Yes. It is a bit hackish, but try the the following. First in your Actions.xml <ConfigUI> create a hidden <Field> to hold a description text value:
- Code: Select all
<Field id="description" type="textfield" hidden="true">
<Label>runtime calculated</Label>
</Field>
Next, in your plugin's validateActionConfigUi method have it calculate the UI description you want displayed and stuff that into the "description" value:
- Code: Select all
def validateActionConfigUi(self, valuesDict, typeId, devId):
errorsDict = indigo.Dict()
# Calculate a good UI description based on all of the action values.
valuesDict[u"description"] = u"some runtime calculated description; you can lookup the device name and use it here"
if len(errorsDict) > 0:
return (False, valuesDict, errorsDict)
return (True, valuesDict)
Note that this won't automatically add good descriptions for all the actions already in someone's database, but as they open and save out of the action dialogs the descriptions should be filled in and then they are cached off and saved in the database.