Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

How to use events that contain spaces.

If you have a question or need help, this is the place to be.
Post Reply
DarkCinema
Posts: 25
Joined: Wed Sep 26, 2012 10:46 pm

How to use events that contain spaces.

Post by DarkCinema »

I receive events like: PioneerEthernet.Received.Power.State '0'
How can I use this as an event to trigger an action? Dragging and dropping only drops "PioneerEthernet.Received.Power.State" without the '0' How should I use the full event with the '0' ?

Ok read that this has to do with the payload.
What would bet the syntax for this : eg.TriggerEvent(eg.event.payload ??, prefix = eg.event.suffix)
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: How to use events that contain spaces.

Post by krambriw »

You have to create a macro where you typically would place also a python script. A very simple one is this:

Code: Select all

pl = eg.event.payload
print pl
This script, when triggered, will capture the payload in the variable pl and then simply print it. Obviously you would do some more with the captured data but it gives you an idea.

To trigger the macro and the script, you can just drag & drop your event "PioneerEthernet.Received.Power.State" to the same macro. Next time the event happens, the macro will be triggered, the script executed and the value of the variable printed in the log.

BestR
Walter
DarkCinema
Posts: 25
Joined: Wed Sep 26, 2012 10:46 pm

Re: How to use events that contain spaces.

Post by DarkCinema »

Thanks Walter,

I found out that whan using the following script, it will create an event with the first 10 characters:
"eg.TriggerEvent(eg.event.payload[0:10], prefix = eg.event.suffix)"

So I am using this to detect the current AUDIO type on my receiver:
With the above script his event: "PioneerEthernet.Received.AST.Signal 'PCM'"will crate a new event: "Received.AST.Signal.PCM" that I can use to trigger my lights.

Do you know how to program a new event when the outcome of "PioneerEthernet.Received.AST.Signal 'PCM'" is anythinbg else than PCM ?
kkl
Experienced User
Posts: 317
Joined: Wed May 04, 2011 9:32 pm

Re: How to use events that contain spaces.

Post by kkl »

Use the other Pioneer plug-in that sem;colon already pointed you to in another thread and see the end of the thread for info on the payload.
DarkCinema
Posts: 25
Joined: Wed Sep 26, 2012 10:46 pm

Re: How to use events that contain spaces.

Post by DarkCinema »

kkl wrote:Use the other Pioneer plug-in that sem;colon already pointed you to in another thread and see the end of the thread for info on the payload.
Thx.
Post Reply