Using Multiple Custom Devices in Actions.xml deviceFilter?

Posted on
Mon Oct 08, 2012 11:17 am
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Using Multiple Custom Devices in Actions.xml deviceFilter?

I looked through the Indigo plugin developer documentation and couldn't find any way of specifying more than one custom device in the "deviceFilter" attribute of an action defined in the Actions.xml file. Is it possible, or do I have to create a custom dialog to select from a list of compatible devices. Here's an example of what I want to do.

Code: Select all
   <Action id="zone1powerOn" deviceFilter="self.vsx1021k,self.vsx1122k">
      <Name>Power On (Zone 1)</Name>
      <CallbackMethod>zone1powerOn</CallbackMethod>
   </Action>

That doesn't work, however (using Indigo 5.1.6). While loading the plugin returns no errors, when that action is selected in an Indigo action, only the "vsx1122k" device type is listed in the Device menu. If it's not possible to AND multiple deviceTypeId values, is it possible to negate a specific deviceTypeId from the list? Is it possible to use a custom callback function so the plugin generates the list of devices rather than relying on Indigo to do that?
Last edited by nsheldon on Tue Oct 09, 2012 2:28 pm, edited 1 time in total.

Posted on
Tue Oct 09, 2012 2:28 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Using Multiple Custom Devices in Actions.xml deviceFilte

This is the document I'm looking at. Should I be looking at a different document for Actions.xml configuration?

Posted on
Tue Oct 09, 2012 3:24 pm
matt (support) offline
Site Admin
User avatar
Posts: 21427
Joined: Jan 27, 2003
Location: Texas

Re: Using Multiple Custom Devices in Actions.xml deviceFilte

Improving this is definitely on our list, but currently you cannot specify more than one type. You can specify just "self" which will show all of that plugin's devices, but if you need finer control then you'll have to manually handle the device popup in the action ConfigUI (which isn't ideal especially if that is the only control).

Image

Posted on
Tue Oct 09, 2012 3:54 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Using Multiple Custom Devices in Actions.xml deviceFilte

Hey Matt. Thanks for the info. That's kind of what I figured. That will end up being a bit of a pain for the Pioneer Receiver plugin actions (of which there are many that will need their own ConfigUI dialog now). Is there a method that's called (to which plugin/Python developers have access), when the user either selects a device in the Indigo UI's plugin action dialog box (i.e. when Plugin is selected for the action Type, a Plugin is selected, an Action is selected under that, and then a Device is selected under that), or when the OK button is clicked on in a dialog box containing a Plugin action? Perhaps it could be overloaded to return an error if an incompatible device is selected?

Posted on
Tue Oct 09, 2012 3:59 pm
matt (support) offline
Site Admin
User avatar
Posts: 21427
Joined: Jan 27, 2003
Location: Texas

Re: Using Multiple Custom Devices in Actions.xml deviceFilte

Nope, the best you could do is show all of your plugin's devices then whenever the action is executed with a incompatible device have it write an error to the Event Log.

Image

Posted on
Tue Oct 09, 2012 4:12 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Using Multiple Custom Devices in Actions.xml deviceFilte

Okay. Thanks. I'll think about how best to proceed then. If it isn't already on the to-do/feature request list, I'd like to request the ability to either submit multiple custom devices in the deviceFilter attribute of an Actions.xml configuration, or add the option for a deviceFilterCallback (or similar callback) attribute so the plugin can return a filtered list to Indigo.

Posted on
Wed Oct 10, 2012 6:53 am
matt (support) offline
Site Admin
User avatar
Posts: 21427
Joined: Jan 27, 2003
Location: Texas

Re: Using Multiple Custom Devices in Actions.xml deviceFilte

Yep, it is definitely on our wish list.

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests