Ordering of commands

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

Moderator: leecollings

Post Reply
poudenes
Posts: 667
Joined: Wednesday 08 March 2017 9:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

Ordering of commands

Post by poudenes »

Hi All,

I was wondering if the order of commands are important to let them work?

light.switchOff().checkFirst().afterDec(5)
light.switchOff().afterDec(5).checkFirst()

As you see only checkFirst and afterSec are switched. Will this have impact on how they behave?
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Ordering of commands

Post by waaren »

poudenes wrote: Thursday 30 May 2019 11:23 I was wondering if the order of commands are important to let them work?
light.switchOff().checkFirst().afterSec(5)
light.switchOff().afterSec(5).checkFirst()
Will this have impact on how they behave?
No makes no difference. The check from checkFirst() will happen at the moment the script finished. So in both cases irrespective what will happen later with the switch; if the light was Off the moment the script finished, no switchOff() command will send to domoticz.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
poudenes
Posts: 667
Joined: Wednesday 08 March 2017 9:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

Re: Ordering of commands

Post by poudenes »

Thanks again Waaren!!
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest