Author Topic: scene, multi event trigger and luup code  (Read 1816 times)

Offline tuxtof

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
scene, multi event trigger and luup code
« on: September 06, 2011, 02:15:51 pm »
i have a scene with multiple event trigger (all my sensor) and who run a luup code

in the lump code how to get the event name who launch the scene to use it in lump action ?

thanks for your help

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3258
  • Karma: +191/-9
Re: scene, multi event trigger and luup code
« Reply #1 on: September 06, 2011, 05:52:13 pm »
Huh, good question.  If there is one, it's not documented anywhere.

Try this as a workaround...

For each event, go into its "Luup Event" code and set a variable:
Code: [Select]
triggeredby = "Door1Opened"
return true

Then in the main Luup tab, see if you can act on this variable:
Code: [Select]
if (triggeredby == "Door1Opened") then
...
end

I don't know if the variables you set in Luup Event code tunnel through to the main Luup code.  Let us know if it works.

Offline tuxtof

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: scene, multi event trigger and luup code
« Reply #2 on: September 07, 2011, 03:32:15 am »
Hi

good response , it's work

just one warning defined variable in lump event code is a global variable, if you use multiple event of this kind, think you use different variable name


thanks futzle