Implementation request: trigger on value

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Implementation request: trigger on value

Post by emme »

Ciao,

it might be possible to implement a much sharp control of trigger?
as now if you want to trigger a device you have to enter

Code: Select all

on = {devices = {'myDevice'}},
then in the execute section you can check its state as per your use:

Code: Select all

if device.state == "On" then 
   do my stuff
end
what about replaving with

Code: Select all

on = {devices = {'myDevice' == 'On'}},
and by conseguence the execution part would be

Code: Select all

do my stuff
it is applicable? :P :P
ciao
M
The most dangerous phrase in any language is:
"We always done this way"
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Implementation request: trigger on value

Post by EddyG »

I am not in favour.
You save 2 lines of code and some extra code.
Proberly those 2 lines 'shift' to the dzVents code, so total evaluation takes more time.
You cannot debug the 'Off' state.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest