add holidayWeekend Support for brightness

This commit is contained in:
Marko Oldenburg 2020-03-23 12:02:17 +01:00
parent 46eb9da8c8
commit 4bdb540368

View File

@ -3900,9 +3900,98 @@ sub ShuttersSunrise($$) {
}
}
elsif ( $shutters->getUp eq 'brightness' ) {
$shuttersSunriseUnixtime =
computeAlignTime( '24:00', $shutters->getTimeUpLate );
if ( ( IsWe() or IsWeTomorrow() )
and $ascDev->getSunriseTimeWeHoliday eq 'on'
and $shutters->getTimeUpWeHoliday ne '01:25' )
{
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->getTimeUpLate )
) / 86400
)
)
{
$shuttersSunriseUnixtime =
computeAlignTime( '24:00', $shutters->getTimeUpWeHoliday );
}
else {
$shuttersSunriseUnixtime =
computeAlignTime( '24:00', $shutters->getTimeUpLate );
}
}
else {
if (
IsWe()
and (
int( gettimeofday() / 86400 ) == int(
(
computeAlignTime( '24:00', $shutters->getTimeUpWeHoliday )
) / 86400
)
or 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->getTimeUpLate )
) / 86400
)
)
{
$shuttersSunriseUnixtime =
computeAlignTime( '24:00', $shutters->getTimeUpLate );
}
else {
if (
int( gettimeofday() / 86400 ) == int(
(
computeAlignTime( '24:00', $shutters->getTimeUpWeHoliday )
) / 86400
)
)
{
$shuttersSunriseUnixtime =
computeAlignTime( '24:00', $shutters->getTimeUpWeHoliday );
}
else {
$shuttersSunriseUnixtime =
computeAlignTime( '24:00', $shutters->getTimeUpWeHoliday );
}
}
}
}
else {
$shuttersSunriseUnixtime =
computeAlignTime( '24:00', $shutters->getTimeUpLate );
}
}
return $shuttersSunriseUnixtime;
}
elsif ( $tm eq 'real' ) {