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 ?
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.
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
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: distinguish between the events
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.
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
Re: distinguish between the events
I do don't know anything in Python script
can anyone help with this?
Thanks
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
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'?
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'
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
Re: distinguish between the events
Works great, thank you 