Page 1 of 1

repeatAfterSec Question

Posted: Saturday 25 August 2018 11:43
by DanM
Hi,

If I have the following in one of my scripts, will it cause dzVents to wait until this is executed before anything else is executed? If so is there any way to push this to the background and continue other stuff?

domoticz.devices('Camera Snapshot').switchOn().forSec(2).repeatAfterSec(3, 10)

This is a bit of code that take shots from my camera if motion is detected when the security panel is engaged - when it gets triggered it seems to prevent the security panel change being processed (so if you then disengage the alarm it takes a while).

Thanks,

Dan

Re: repeatAfterSec Question

Posted: Saturday 25 August 2018 11:48
by waaren
DanM wrote: Saturday 25 August 2018 11:43 ..
If I have the following in one of my scripts, will it cause dzVents to wait until this is executed before anything else is executed? If so is there any way to push this to the background and continue other stuff?
domoticz.devices('Camera Snapshot').switchOn().forSec(2).repeatAfterSec(3, 10)
dzVents will not wait until this is executed but will just continue and send this to domoticz when your script is finished.

Re: repeatAfterSec Question

Posted: Saturday 25 August 2018 11:55
by DanM
Thanks. Does that hold true for other scripts too? so say that line is in the middle of script A.. I understand from what you are saying that the rest of script A executes and then this is sent to domoticz at the end? What if script B is triggered in the meanwhile,will this suffer a delay?

Re: repeatAfterSec Question

Posted: Saturday 25 August 2018 12:24
by waaren
DanM wrote: Saturday 25 August 2018 11:55 Thanks. Does that hold true for other scripts too? so say that line is in the middle of script A.. I understand from what you are saying that the rest of script A executes and then this is sent to domoticz at the end? What if script B is triggered in the meanwhile,will this suffer a delay?
The event system of domoticz (and therewith dzVents) is single threaded. Script B will not start before script A has finished.