remove IsWeTomorrow Fn and change IsWe Fn to use tomorrow

This commit is contained in:
Marko Oldenburg 2020-03-24 09:29:42 +01:00
parent b608d511ce
commit 0e9a212aa0

View File

@ -57,7 +57,7 @@ package FHEM::AutoShuttersControl;
use strict; use strict;
use warnings; use warnings;
use POSIX; use POSIX qw(strftime);
use utf8; use utf8;
use Encode; use Encode;
use FHEM::Meta; use FHEM::Meta;
@ -3590,11 +3590,11 @@ sub ShuttersSunrise($$) {
if ( $tm eq 'unix' ) { if ( $tm eq 'unix' ) {
if ( $shutters->getUp eq 'astro' ) { if ( $shutters->getUp eq 'astro' ) {
if ( ( IsWe() or IsWeTomorrow() ) if ( ( IsWe() or IsWe('tomorrow') )
and $ascDev->getSunriseTimeWeHoliday eq 'on' and $ascDev->getSunriseTimeWeHoliday eq 'on'
and $shutters->getTimeUpWeHoliday ne '01:25' ) and $shutters->getTimeUpWeHoliday ne '01:25' )
{ {
if ( not IsWeTomorrow() ) { if ( not IsWe('tomorrow') ) {
if ( if (
IsWe() IsWe()
and int( gettimeofday() / 86400 ) == int( and int( gettimeofday() / 86400 ) == int(
@ -3781,11 +3781,11 @@ sub ShuttersSunrise($$) {
} }
if ( defined($oldFuncHash) if ( defined($oldFuncHash)
and ref($oldFuncHash) eq 'HASH' and ref($oldFuncHash) eq 'HASH'
and ( IsWe() or IsWeTomorrow() ) and ( IsWe() or IsWe('tomorrow') )
and $ascDev->getSunriseTimeWeHoliday eq 'on' and $ascDev->getSunriseTimeWeHoliday eq 'on'
and $shutters->getTimeUpWeHoliday ne '01:25' ) and $shutters->getTimeUpWeHoliday ne '01:25' )
{ {
if ( not IsWeTomorrow() ) { if ( not IsWe('tomorrow') ) {
if ( if (
int( gettimeofday() / 86400 ) == int( int( gettimeofday() / 86400 ) == int(
( (
@ -3818,11 +3818,11 @@ sub ShuttersSunrise($$) {
} }
} }
elsif ( $shutters->getUp eq 'time' ) { elsif ( $shutters->getUp eq 'time' ) {
if ( ( IsWe() or IsWeTomorrow() ) if ( ( IsWe() or IsWe('tomorrow') )
and $ascDev->getSunriseTimeWeHoliday eq 'on' and $ascDev->getSunriseTimeWeHoliday eq 'on'
and $shutters->getTimeUpWeHoliday ne '01:25' ) and $shutters->getTimeUpWeHoliday ne '01:25' )
{ {
if ( not IsWeTomorrow() ) { if ( not IsWe('tomorrow') ) {
if ( if (
int( gettimeofday() / 86400 ) == int( int( gettimeofday() / 86400 ) == int(
computeAlignTime( '24:00', computeAlignTime( '24:00',
@ -3900,11 +3900,11 @@ sub ShuttersSunrise($$) {
} }
} }
elsif ( $shutters->getUp eq 'brightness' ) { elsif ( $shutters->getUp eq 'brightness' ) {
if ( ( IsWe() or IsWeTomorrow() ) if ( ( IsWe() or IsWe('tomorrow') )
and $ascDev->getSunriseTimeWeHoliday eq 'on' and $ascDev->getSunriseTimeWeHoliday eq 'on'
and $shutters->getTimeUpWeHoliday ne '01:25' ) and $shutters->getTimeUpWeHoliday ne '01:25' )
{ {
if ( not IsWeTomorrow() ) { if ( not IsWe('tomorrow') ) {
if ( if (
IsWe() IsWe()
and int( gettimeofday() / 86400 ) == int( and int( gettimeofday() / 86400 ) == int(
@ -4133,7 +4133,7 @@ sub CheckIfShuttersWindowRecOpen($) {
} }
sub makeReadingName($) { sub makeReadingName($) {
my ($rname) = @_; my ($rname) = shift;
my %charHash = ( my %charHash = (
chr(0xe4) => "ae", # ä chr(0xe4) => "ae", # ä
chr(0xc4) => "Ae", # Ä chr(0xc4) => "Ae", # Ä
@ -4159,14 +4159,8 @@ sub TimeMin2Sec($) {
return $sec; return $sec;
} }
sub IsWe() { sub IsWe {
my $we = main::IsWe(); return main::IsWe(shift);
return $we;
}
sub IsWeTomorrow() {
my $we = main::IsWe('tomorrow');
return $we;
} }
sub _SetCmdFn($) { sub _SetCmdFn($) {
@ -8038,7 +8032,7 @@ sub getBlockAscDrivesAfterManual {
], ],
"release_status": "testing", "release_status": "testing",
"license": "GPL_2", "license": "GPL_2",
"version": "v0.8.20", "version": "v0.8.21",
"author": [ "author": [
"Marko Oldenburg <leongaultier@gmail.com>" "Marko Oldenburg <leongaultier@gmail.com>"
], ],