98_MSwitch.pm:fix Calculation time range over date limit

git-svn-id: https://svn.fhem.de/fhem/trunk@18049 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Byte09
2018-12-25 06:42:59 +00:00
parent d977d5b5de
commit 3d961cd545

View File

@@ -6580,7 +6580,7 @@ sub MSwitch_checkcondition($$$) {
if ( $field =~ m/([0-9]{2}):([0-9]{2}):([0-9]{2})/ ) {
my $hh = $1;
if ( $hh > 23 ) { $hh = $hh - 24 }
if ( $hh < 10 ) { $hh = "0" . $hh }
#if ( $hh < 10 ) { $hh = "0" . $hh }
$field = $hh . ":" . $2;
}
@@ -6937,7 +6937,7 @@ sub MSwitch_Checkcond_time($$) {
#my $time1;
my ( $tday, $tmonth, $tdate, $tn ); #my ($tday,$tmonth,$tdate,$tn,$time1);
if ( ( $akthour < $hour1 && $akthour < $hour2 ) && $hour2 < $hour1 ) # und
if ( ( $akthour < $hour1 && $akthour <= $hour2 ) && $hour2 < $hour1 ) # und
{
use constant SECONDS_PER_DAY => 60 * 60 * 24;
$timecondtest = localtime( time - SECONDS_PER_DAY );