2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

57_Calendar: deal with non-existent end times

git-svn-id: https://svn.fhem.de/fhem/trunk@6654 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
borisneubert 2014-10-02 17:44:53 +00:00
parent f01a844bf5
commit 8f7b4a0921
2 changed files with 8 additions and 1 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
- feature: 57_Calendar: deal with non-existent end times
- bugfix: SOMFY: fix non-working on/off-for-timer methods
made positioning attributes optional
- feature: SOMFY: support for exact positioning (one-time setup of run times required)

View File

@ -622,12 +622,18 @@ sub isAlarmed {
sub isStarted {
my ($self,$t) = @_;
return 0 if($self->isDeleted());
return $self->{start}<= $t && $t< $self->{end} ? 1 : 0;
return 0 unless(defined($self->{start}));
return 0 if($t < $self->{start});
if(defined($self->{end})) {
return 0 if($t>= $self->{end});
}
return 1;
}
sub isEnded {
my ($self,$t) = @_;
return 0 if($self->isDeleted());
return 0 unless(defined($self->{end}));
return $self->{end}<= $t ? 1 : 0;
}