fix little bug

add export for EventProcessingFunctions
This commit is contained in:
Marko Oldenburg 2020-07-09 08:44:18 +02:00
parent a27233869b
commit 58f86d05e0
3 changed files with 36 additions and 21 deletions

View File

@ -1,10 +1,10 @@
UPD 2020-07-08_22:02:31 97041 FHEM/73_AutoShuttersControl.pm
UPD 2020-07-09_08:21:08 74284 lib/FHEM/Automation/ShuttersControl.pm
UPD 2020-07-09_08:43:46 73984 lib/FHEM/Automation/ShuttersControl.pm
UPD 2020-06-22_09:41:40 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm
UPD 2020-07-07_14:49:19 2496 lib/FHEM/Automation/ShuttersControl/Roommate.pm
UPD 2020-07-08_22:06:53 30760 lib/FHEM/Automation/ShuttersControl/Shutters.pm
UPD 2020-07-09_08:19:25 23216 lib/FHEM/Automation/ShuttersControl/Shading.pm
UPD 2020-07-09_08:18:27 107020 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm
UPD 2020-07-09_08:41:10 107681 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm
UPD 2020-07-09_08:18:54 44235 lib/FHEM/Automation/ShuttersControl/Helper.pm
UPD 2020-06-22_09:41:40 2175 lib/FHEM/Automation/ShuttersControl/Window.pm
UPD 2020-07-08_22:06:53 11569 lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm

View File

@ -76,6 +76,7 @@ use Date::Parse;
use FHEM::Automation::ShuttersControl::Shutters;
use FHEM::Automation::ShuttersControl::Dev;
use FHEM::Automation::ShuttersControl::EventProcessingFunctions qw (:ALL);
use FHEM::Automation::ShuttersControl::Shading qw (:ALL);
use FHEM::Automation::ShuttersControl::Helper qw (:ALL);
@ -494,8 +495,7 @@ sub Notify {
}
}
elsif ( grep m{^partyMode:.off$}xms, @{$events} ) {
FHEM::Automation::ShuttersControl::EventProcessingFunctions::EventProcessingPartyMode(
$hash);
EventProcessingPartyMode($hash);
}
elsif ( grep m{^sunriseTimeWeHoliday:.(on|off)$}xms, @{$events} ) {
RenewSunRiseSetShuttersTimer($hash);
@ -509,8 +509,7 @@ m{^(ATTR|DELETEATTR)\s(.*ASC_Time_Up_WE_Holiday|.*ASC_Up|.*ASC_Down|.*ASC_AutoAs
@{$events}
)
{
FHEM::Automation::ShuttersControl::EventProcessingFunctions::EventProcessingGeneral(
$hash, undef, join( ' ', @{$events} ) );
EventProcessingGeneral( $hash, undef, join( ' ', @{$events} ) );
}
}
elsif ( grep m{^($posReading):\s\d{1,3}$}xms, @{$events} ) {
@ -518,12 +517,10 @@ m{^(ATTR|DELETEATTR)\s(.*ASC_Time_Up_WE_Holiday|.*ASC_Up|.*ASC_Down|.*ASC_AutoAs
. ' ASC_Pos_Reading Event vom Rollo wurde erkannt '
. ' - RECEIVED EVENT: '
. Dumper $events);
FHEM::Automation::ShuttersControl::EventProcessingFunctions::EventProcessingShutters(
$hash, $devname, join( ' ', @{$events} ) );
EventProcessingShutters( $hash, $devname, join( ' ', @{$events} ) );
}
else {
FHEM::Automation::ShuttersControl::EventProcessingFunctions::EventProcessingGeneral(
$hash, $devname, join( ' ', @{$events} ) )
EventProcessingGeneral( $hash, $devname, join( ' ', @{$events} ) )
; # bei allen anderen Events wird die entsprechende Funktion zur Verarbeitung aufgerufen
}
@ -594,8 +591,7 @@ sub Set {
}
elsif ( lc $cmd eq 'advdrivedown' ) {
return "usage: $cmd" if ( scalar( @{$aArg} ) != 0 );
FHEM::Automation::ShuttersControl::EventProcessingFunctions::EventProcessingAdvShuttersClose(
$hash);
EventProcessingAdvShuttersClose($hash);
}
elsif ( lc $cmd eq 'shutterascenabletoggle' ) {
return "usage: $cmd" if ( scalar( @{$aArg} ) > 1 );

View File

@ -47,14 +47,33 @@ use utf8;
use FHEM::Automation::ShuttersControl::Helper qw (:ALL);
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(
CheckASC_ConditionsForShadingFn
ShadingProcessing
ShadingProcessingDriveCommand
);
our %EXPORT_TAGS = (
ALL => [
qw(
EventProcessingPartyMode
EventProcessingGeneral
EventProcessingShutters
EventProcessingAdvShuttersClose
)
],
);
use GPUtils qw(GP_Import);
## Import der FHEM Funktionen
BEGIN {
GP_Import(
qw(
Log3
gettimeofday
computeAlignTime
EventProcessingPartyMode
EventProcessingGeneral
EventProcessingShutters
EventProcessingAdvShuttersClose
)
);
}
@ -68,8 +87,8 @@ sub EventProcessingGeneral {
if ( defined($devname) && ($devname) )
{ # es wird lediglich der Devicename der Funktion mitgegeben wenn es sich nicht um global handelt daher hier die Unterscheidung
my $windReading = $ascDev->getWindSensorReading // 'none';
my $rainReading = $ascDev->getRainSensorReading // 'none';
my $windReading = $FHEM::Automation::ShuttersControl::ascDev->getWindSensorReading // 'none';
my $rainReading = $FHEM::Automation::ShuttersControl::ascDev->getRainSensorReading // 'none';
while ( my ( $device, $deviceAttr ) =
each %{ $hash->{monitoredDevs}{$devname} } )
@ -96,13 +115,13 @@ sub EventProcessingGeneral {
EventProcessingExternalTriggerDevice( $hash, $device, $events )
if ( $deviceAttr eq 'ASC_ExternalTrigger' );
$shutters->setShuttersDev($device)
$FHEM::Automation::ShuttersControl::shutters->setShuttersDev($device)
if ( $deviceAttr eq 'ASC_BrightnessSensor' );
if (
$deviceAttr eq 'ASC_BrightnessSensor'
&& ( $shutters->getDown eq 'brightness'
|| $shutters->getUp eq 'brightness' )
&& ( $FHEM::Automation::ShuttersControl::shutters->getDown eq 'brightness'
|| $FHEM::Automation::ShuttersControl::shutters->getUp eq 'brightness' )
)
{
EventProcessingBrightness( $hash, $device, $events );
@ -153,7 +172,7 @@ sub EventProcessingGeneral {
if (
$3 ne 'ASC_Time_Up_WE_Holiday'
|| ( $3 eq 'ASC_Time_Up_WE_Holiday'
&& $ascDev->getSunriseTimeWeHoliday eq 'on' )
&& $FHEM::Automation::ShuttersControl::ascDev->getSunriseTimeWeHoliday eq 'on' )
);
}
elsif (