Page 1 of 1

same devicechanged in more LUA's

Posted: Thursday 31 January 2019 14:29
by ensingg
Hi,

I like to split up my main LUA script to more small functional LUA scripts. More neat programming I think.
But now I have a question.

I have an ALARM.LUA that checks some stuff related to the alarm triggers.
There is a devicechangend check for DOOR

But I like to do a devicechanged check for DOOR in other script too.
(for switched lights on - in this example)

But when I have to LUA scripts (type device) and do DEVICECHANGED for the same thing in both scripts. Will this work?

Re: same devicechanged in more LUA's

Posted: Thursday 31 January 2019 17:42
by Siewert308SW
For sure it will work.
Even if you want 30 different Lua event files/scripts to be triggered on a certain devicechange

Re: same devicechanged in more LUA's

Posted: Thursday 31 January 2019 17:44
by waaren
ensingg wrote: Thursday 31 January 2019 14:29 I like to split up my main LUA script to more small functional LUA scripts. More neat programming I think.
But now I have a question.

I have an ALARM.LUA that checks some stuff related to the alarm triggers.
There is a devicechangend check for DOOR

But I like to do a devicechanged check for DOOR in other script too.
(for switched lights on - in this example)

But when I have to LUA scripts (type device) and do DEVICECHANGED for the same thing in both scripts. Will this work?
Yes. Does work in Lua and also in dzVents