The "Trigger Event" -action is a bit different from eg.TriggerEvent as it includes an option for a time delay. Actually, the action is defined in EventGhost\plugins\EventGhost\__init__.py and it internally it uses the eg.scheduler.AddTask to delay the triggering of the event.
So, what you are really looking for something to run a command after a set time.
Using eg.Utils.threading.Timer.
Code: Select all
def test():
eg.TriggerEvent(u'test')
t = eg.Utils.threading.Timer(30.0, test)
t.start()
You can read more
about threading.Timer at python docs.
EventGhost also has a custom scheduler thread which is a bit easier to use.
Code: Select all
eg.scheduler.AddTask(5, eg.TriggerEvent, 'hello', 'payload')
The first parameter is the number of seconds after which the command will be run. Notice how the parameters starting from 'hello' are being passed to eg.TriggerEvent