2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-09 20:57:11 +00:00

changed to make repeating events occur COUNT times (was COUNT+1 times before this change)

git-svn-id: https://svn.fhem.de/fhem/trunk@2569 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
borisneubert 2013-01-26 14:22:51 +00:00
parent 72f0f2def0
commit 011805e70e

View File

@ -476,7 +476,8 @@ sub advanceToNextOccurance {
# See RFC 2445 page 39 and following
return if(!exists($self->{freq})); #This event is not reoccuring
return if(exists($self->{count}) and $self->{count} == 0); #We are already at the last occurance
$self->{count}-- if(exists($self->{count})); # since we look for the next occurance we have to decrement count first
return if(exists($self->{count}) and $self->{count} <= 0); #We are already at the last occurance
my @weekdays = qw(SU MO TU WE TH FR SA);
#There are no leap seconds in epoch time
@ -523,7 +524,6 @@ sub advanceToNextOccurance {
#the UNTIL clause is inclusive, so $newt == $self->{until} is okey
return if(exists($self->{until}) and $nextstart > $self->{until});
$self->{count} -= 1 if(exists($self->{count}));
my $duration = $self->{end} - $self->{start};
$self->{start} = $nextstart;