|
|
|
Page 1 of 1
|
[ 5 posts ] |
|
How to fire a custom event ?
| Author |
Message |
|
Juju
Joined: Aug 31, 2011 Posts: 56 Location: Toulouse - FRANCE
|
 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 |
|
 |
|
berkinet
Joined: Nov 18, 2008 Posts: 1721 Location: Berkeley, CA
|
 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 |
|
 |
|
Juju
Joined: Aug 31, 2011 Posts: 56 Location: Toulouse - FRANCE
|
 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 |
|
 |
|
berkinet
Joined: Nov 18, 2008 Posts: 1721 Location: Berkeley, CA
|
 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 |
|
 |
|
Juju
Joined: Aug 31, 2011 Posts: 56 Location: Toulouse - FRANCE
|
 Re: How to fire a custom event ?
That's a nice info. Thanks Berkinet.
|
| Mon Feb 13, 2012 1:19 am |
|
|
|
Page 1 of 1
|
[ 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
|
|