Page 1 of 1

Plugin Trigger

Posted: 17 Aug 2015 16:19
by Rm.
Hello,

Automagic documentation for "Trigger Plugin" (not Trigger Plugin Event) states that "The trigger Plugin (Experimental) executes a flow when the condition of a plugin changes to true and/or false.".

Can you please tell me whether Automagic queries the Plugin regularly in some interval? (if so, how often?) Or does Automagic query the plugin only after it receives ACTION_REQUEST_QUERY from the plugin itself? If so, what's the difference between Trigger Plugin and Trigger Plugin Event?

Thanks in advance for your answers.

Re: Plugin Trigger

Posted: 19 Aug 2015 20:06
by Martin
Hi,

Trigger Plugin queries the plugin when the plugin sends an ACTION_REQUEST_QUERY (and once to get the initial state when the trigger becomes active). The trigger does not use a timer to periodically check the plugin.

Trigger Plugin and Plugin Event are very similar. Main difference is that Plugin internally holds the last reported state from the plugin and executes the flow only when the state changes so it's more suitable for states the persist for a duration. Plugin Event executes the flow whenever the Plugin sends ACTION_REQUEST_QUERY and the plugin then returns RESULT_CODE_SATISFIED (irrespective if it was RESULT_CODE_SATISFIED before). Plugin Event also supports pass through data which might be helpful for some plugins to pass an ID of the event or something similar.
Plugin Event was an extension introduced by Tasker so it might not be supported by all automation tools.

Regards,
Martin