View unanswered posts | View active topics It is currently Thu May 23, 2013 5:48 am



Reply to topic  [ 5 posts ] 
 How to fire a custom event ? 
Author Message

Joined: Aug 31, 2011
Posts: 56
Location: Toulouse - FRANCE
Post How to fire a custom event ?
Hello,

I defined some custom events into Events.xml.
I understand I have to catch and store the triggers defined with my plugin events using triggerStartProcessing (self, trigger). To do this, I planed to store them into a dict. But I don't understand how I can know which event (from Events.xml) is used by the trigger ... I think the link is made with the event id, but how to have it through the trigger passed in parameter with triggerStartProcessing (self, trigger) ?


Sun Feb 12, 2012 11:53 am
Profile
User avatar

Joined: Nov 18, 2008
Posts: 1721
Location: Berkeley, CA
Post Re: How to fire a custom event ?
Take a look at the trigger object. Just print it out to the log with indigo.server.log
indigo.server.log('Received trigger object:\n%s' % trigger)


Sun Feb 12, 2012 12:15 pm
Profile

Joined: Aug 31, 2011
Posts: 56
Location: Toulouse - FRANCE
Post Re: How to fire a custom event ?
OK, thanks berkinet.
Triggers has property pluginTypeId with the event id.

Thanks.

Julien


Sun Feb 12, 2012 12:55 pm
Profile
User avatar

Joined: Nov 18, 2008
Posts: 1721
Location: Berkeley, CA
Post Re: How to fire a custom event ?
BTW, Similar to devices, etc. you can also look at a trigger in the Indigo Scripting shell (Plugins > Open Scripting Shell). Try:
print indigo.triggers[trigger-ID]

For example
print indigo.triggers[154961128]


Sun Feb 12, 2012 1:16 pm
Profile

Joined: Aug 31, 2011
Posts: 56
Location: Toulouse - FRANCE
Post Re: How to fire a custom event ?
That's a nice info.
Thanks Berkinet.


Mon Feb 13, 2012 1:19 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.   Template designed by STSoftware.