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.

distinguish between the events

If you have a question or need help, this is the place to be.
Post Reply
thealon
Posts: 7
Joined: Wed Oct 22, 2014 1:18 pm

distinguish between the events

Post by thealon »

my device sending 2 Different event
but eventghost Think they are the same

Main.zVirtualScenes.LastNodeEventValue (u'\u05d7\u05d9\u05d9\u05e9\u05df \u05d3\u05dc\u05ea', u'12', u'0')

Main.zVirtualScenes.LastNodeEventValue (u'\u05d7\u05d9\u05d9\u05e9\u05df \u05d3\u05dc\u05ea', u'12', u'255')

How do I distinguish between the events ?
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: distinguish between the events

Post by krambriw »

You need to create a macro with a python script that compares the payloads. Specifically, depending on '0' or '255', the script can execute different functions.
thealon
Posts: 7
Joined: Wed Oct 22, 2014 1:18 pm

Re: distinguish between the events

Post by thealon »

I do don't know anything in Python script :|

can anyone help with this?

Thanks
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: distinguish between the events

Post by krambriw »

Create a macro with a python script. Copy & Paste the example below. Drag & Drop the event to the macro.
What remains is to figure out what you want shall happen when the value is '0' or '255'?

Code: Select all

#p = (u'\u05d7\u05d9\u05d9\u05e9\u05df \u05d3\u05dc\u05ea', u'12', u'0')
p = eg.event.payload
if p[2] == '0':
    print 'Do this'
if p[2] == '255':
    print 'Do that'
thealon
Posts: 7
Joined: Wed Oct 22, 2014 1:18 pm

Re: distinguish between the events

Post by thealon »

Works great, thank you :D
Post Reply