Page 1 of 1

Timer between time/day and time day doesn't work

Posted: Monday 19 April 2021 15:40
by Ray-Man
Version: 2021.1 (build 13203)
Build Hash: ab7a7bba3
Compile Date: 2021-04-19 12:38:14
dzVents Version: 3.1.7
Python Version: 3.8.5 (default, Jan 27 2021, 15:41:15) [GCC 9.3.0]

Hello all,

since the latest stable update (2021.1) the dz.time.matchesRule doesn't seem to work:

The code

Code: Select all

dz.time.matchesRule('between '..T01STARTTIJDOFFSET..' on '..T01STARTDAGOFFSET..' and '..T01STOPTIJDOFFSET..' on '..T01STOPDAGOFFSET) == true
which is

Code: Select all

between 7:30 on mon and 23:29 on mon
gives a false although it should be true (at the moment).

Updated to latest beta (build 13203) has no effect.

Re: Timer between time/day and time day doesn't work

Posted: Monday 19 April 2021 16:11
by waaren
Ray-Man wrote: Monday 19 April 2021 15:40 since the latest stable update (2021.1) the dz.time.matchesRule doesn't seem to work:

Code: Select all

between 7:30 on mon and 23:29 on mon
Can you change the rule to "at 7:30-23:29 on mon" ?

Re: Timer between time/day and time day doesn't work

Posted: Monday 19 April 2021 16:33
by Ray-Man
Yes, that works.

Problem with that solution (I understand it is part of the troubleshooting) is that the second date/time could be after midnight. E.g: between 7:30 on mon and 0:30 on tue. And I don't know how to make that work with 'at'.

Tried at 7:30 on mon and 23:29 on mon -> not working
Tried at 7:30 on mon-23:29 on mon -> not working

Re: Timer between time/day and time day doesn't work

Posted: Monday 19 April 2021 16:51
by Ray-Man
Changed some parameters and I am now testing with 'at 7:30-0:29 on mon' which is working.

Question: does DzVents know that if the stop time is smaller then the start time, the stop day should be the next day and not the same as the starting day?
In other words: is 'at 7:30-0:29 on mon' the same as 'between 7:30 on mon and 0:29 on tue'?

If so, I have to make some changes in numerous scripts, but I can live with that... ;)

Re: Timer between time/day and time day doesn't work

Posted: Monday 19 April 2021 17:04
by waaren
Ray-Man wrote: Monday 19 April 2021 16:33 Problem with that solution is that the second date/time could be after midnight. E.g: between 7:30 on mon and 0:30 on tue. And I don't know how to make that work with 'at'.
You will have to use a combination of two rules for that

Code: Select all

if dz.time.matchesRule('at 7:30-23:59 on mon') or dz.time.matchesRule('at 00:00-00:30 on tue') then