autolog wrote:In a Trigger, is it possible to get the name of the invoking Trigger in a Python Action script
matt (support) wrote:autolog wrote:In a Trigger, is it possible to get the name of the invoking Trigger in a Python Action script
Not currently, but that is on our feature request list. Right now the action is very disconnected (internally) from what is causing it to execute.
wideglidejrp wrote:I have a loosely related question. I would like to create a Python list containing all of my action groups and corresponding group IDs. I could then filter the list to extract action groups which contain a Sonos play command and use that information in other scripts. If I can get help on creating that initial list, I think I can take it from there.
actions = [(a.name, a.id) for a in indigo.actionGroups.iter()]
indigo.server.log(u"{0}".format(actions))
actions = [(a.name, a.id) for a in indigo.actionGroups.iter() if "Sonos Play" in a]
for a in actions:
indigo.server.log(str(a[0]) + "," + str(a[1]))
song_ids = [a.id for a in indigo.actionGroups.iter() if "Sonos Play" in a]
actions = [(a.name, a.id) for a in indigo.actionGroups.iter() if "Sonos Play" in a]
indigo.server.log(str(a[0]) + "," + str(a[1]))
song_ids = [a.id for a in indigo.actionGroups.iter() if "Sonos Play" in a]
indigo.server.log(song_ids)
actions = [(a.name, a.id) for a in indigo.actionGroups.iter() if "Sonos Play" in a.name]
Users browsing this forum: No registered users and 5 guests