Retrieve Device ID from new action dialog

Forum rules

This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo

Posted on
Sun Feb 19, 2012 9:06 pm
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Retrieve Device ID from new action dialog

My plugin needs to create a dynamic list of strings based on the device chosen in an Action Group dialog. Apologies if this is a silly question, but I need to address that particular Device ID when my method to populate the list is called. Here is my action as defined in Actions.xml:

Code: Select all
       <Action id="actionZP_LIST" deviceFilter="self.ZonePlayer">
                 <Name>Sonos Playlist</Name>
                <ConfigUI>
                        <Field id="setting" type="menu">
                                <Label>Sonos Playlist:</Label>
                                <List class="self" method="getZP_LIST" dynamicReload="yes"/>
                        </Field>
                </ConfigUI>
                <CallbackMethod>actionZP_LIST</CallbackMethod>
        </Action>

Posted on
Mon Feb 20, 2012 10:16 am
jay (support) offline
Site Admin
User avatar
Posts: 18265
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Retrieve Device ID from new action dialog

The signature for the dynamic list generator is this:

Code: Select all
 def myListGenerator(self, filter="", valuesDict=None, typeId="", targetId=0)


In the case of this method being called from a config UI for an action that requires selection of a device, the targetId parameter will be the ID of the device selected.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Feb 20, 2012 3:38 pm
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Retrieve Device ID from new action dialog

Thanks Jay - seems simple enough!

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest