2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

73_AutoShuttersControl: add holidayWeekend support for brightness

git-svn-id: https://svn.fhem.de/fhem/trunk@21491 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
LeonGaultier 2020-03-23 11:05:03 +00:00
parent 2965dc5ebe
commit 6efe34d9e9
2 changed files with 92 additions and 2 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: 73_AutoShuttersControl: add holidayWeekend support for brightness
- bugfix: 73_AutoShuttersControl: fix PrivacyDownStatus in Brightness,
add set brightness average max objects in array attribut
- change: 93_DbLog: logfile entry if DBI module not installed, Forum: #109382

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' ) {