jay (support) wrote:Yes, there is a pretty simple solution: create a
plugin-defined event in your plugin.
So rather than using a device state changed trigger, they use your custom event as the trigger. Your custom event would collect the device id and pattern to match and then whenever that state changes in the device your plugin would check it's events to see if there was a match. If there was, then you'd fire the actions.
Look at the Airfoil plugin for examples of plugin-defined events.
Jay,
There's a disconnect in the Wiki documentation....
The wiki describes creating the Events.xml, but doesn't go into any details on how to utilize it.
The Airfoil plugin gives some good examples on how to create the custom XML to create a custom trigger...
But I don't see, in the airfoil python code, how it detects the tri.......
Okay.... I think I partially Grok it now.... But using the Airfoil code as an example is going to cause some massive headaches....
I really, really, *really* encourage you to update the wiki docs, and include some minimalistic examples, that are less convoluted.
Or at least finish the "FixMe"'s....
If I am reading this right...
1) I'll need to add a triggerStartProcessing, to filter just the single trigger I want, and presumably pass on all other triggers. (Presumably the pass on all other triggers is automatic, since I don't see the TriggerStartProcessing passing data to any other function).
2) Ditto for triggerStopProcessing....
- Ben