fix weekendHoliday time then use time for Drive_Up

This commit is contained in:
Marko Oldenburg
2018-11-17 17:10:45 +01:00
parent 8fc9bca4c0
commit 7b2e773b78

View File

@@ -41,7 +41,7 @@ package main;
use strict; use strict;
use warnings; use warnings;
my $version = "0.2.0.6"; my $version = "0.2.0.7";
sub AutoShuttersControl_Initialize($) { sub AutoShuttersControl_Initialize($) {
my ($hash) = @_; my ($hash) = @_;
@@ -1993,12 +1993,68 @@ sub ShuttersSunrise($$$) {
} }
} }
elsif ( $shutters->getUp eq 'time' ) { elsif ( $shutters->getUp eq 'time' ) {
$shuttersSunriseUnixtime = if ( ( IsWe() or IsWeTomorrow() )
computeAlignTime( '24:00', $shutters->getTimeUpEarly ); and $ascDev->getSunriseTimeWeHoliday eq 'on' )
{
if ( not IsWeTomorrow() ) {
if (
IsWe()
and int( gettimeofday() / 86400 ) == int(
computeAlignTime(
'24:00',
$shutters->getTimeUpWeHoliday
)
) / 86400
)
{
$shuttersSunriseUnixtime =
computeAlignTime(
'24:00',
$shutters->getTimeUpWeHoliday
);
}
elsif (
int( gettimeofday() / 86400 ) == int(
computeAlignTime(
'24:00',
$shutters->getTimeUpEarly
)
) / 86400
)
{
$shuttersSunriseUnixtime =
computeAlignTime(
'24:00',
$shutters->getTimeUpWeHoliday
);
}
else {
$shuttersSunriseUnixtime =
computeAlignTime(
'24:00',
$shutters->$shutters->getTimeUpEarly
);
}
}
else {
$shuttersSunriseUnixtime =
computeAlignTime(
'24:00',
$shutters->getTimeUpWeHoliday
);
}
}
else {
$shuttersSunriseUnixtime =
computeAlignTime(
'24:00',
$shutters->$shutters->getTimeUpEarly
);
}
} }
elsif ( $shutters->getUp eq 'brightness' ) { elsif ( $shutters->getUp eq 'brightness' ) {
$shuttersSunriseUnixtime = $shuttersSunriseUnixtime =
computeAlignTime( '24:00', $shutters->getTimeUpLate ); computeAlignTime( '24:00', $shutters->getTimeUpLate );
} }
return $shuttersSunriseUnixtime; return $shuttersSunriseUnixtime;
} }