repeatAfterSec Question

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

Moderator: leecollings

Post Reply
DanM
Posts: 79
Joined: Thursday 23 October 2014 22:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

repeatAfterSec Question

Post 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
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: repeatAfterSec Question

Post 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.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
DanM
Posts: 79
Joined: Thursday 23 October 2014 22:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: repeatAfterSec Question

Post 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?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: repeatAfterSec Question

Post 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.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest