Page 1 of 1

Ordering of commands

Posted: Thursday 30 May 2019 11:23
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?

Re: Ordering of commands

Posted: Thursday 30 May 2019 22:56
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.

Re: Ordering of commands

Posted: Thursday 30 May 2019 23:26
by poudenes
Thanks again Waaren!!