add remove DelayTimer or set new then new rain protection trigger
This commit is contained in:
parent
aadc88c570
commit
774fe63a26
@ -1,10 +1,10 @@
|
||||
UPD 2021-05-17_14:25:13 97974 FHEM/73_AutoShuttersControl.pm
|
||||
UPD 2021-05-17_14:25:13 74350 lib/FHEM/Automation/ShuttersControl.pm
|
||||
UPD 2021-05-17_14:30:37 97974 FHEM/73_AutoShuttersControl.pm
|
||||
UPD 2021-05-17_14:34:49 74350 lib/FHEM/Automation/ShuttersControl.pm
|
||||
UPD 2020-06-22_09:41:40 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm
|
||||
UPD 2020-07-26_17:36:29 2496 lib/FHEM/Automation/ShuttersControl/Roommate.pm
|
||||
UPD 2021-02-26_14:36:10 31487 lib/FHEM/Automation/ShuttersControl/Shutters.pm
|
||||
UPD 2021-05-10_08:26:03 25329 lib/FHEM/Automation/ShuttersControl/Shading.pm
|
||||
UPD 2021-05-17_14:26:04 108472 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm
|
||||
UPD 2021-05-18_08:26:00 32241 lib/FHEM/Automation/ShuttersControl/Shutters.pm
|
||||
UPD 2021-05-17_14:30:37 25329 lib/FHEM/Automation/ShuttersControl/Shading.pm
|
||||
UPD 2021-05-17_14:34:49 108472 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm
|
||||
UPD 2021-02-26_14:36:10 40628 lib/FHEM/Automation/ShuttersControl/Helper.pm
|
||||
UPD 2020-06-22_09:41:40 2175 lib/FHEM/Automation/ShuttersControl/Window.pm
|
||||
UPD 2021-04-27_07:52:31 11742 lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm
|
||||
@ -13,4 +13,4 @@ UPD 2021-01-29_10:06:33 52525 lib/FHEM/Automation/ShuttersControl/Shutters/Attr.
|
||||
UPD 2020-06-22_09:41:40 2903 lib/FHEM/Automation/ShuttersControl/Shutters/Readings.pm
|
||||
UPD 2021-01-29_10:06:33 3980 lib/FHEM/Automation/ShuttersControl/Window/Attr.pm
|
||||
UPD 2020-06-22_09:41:40 2288 lib/FHEM/Automation/ShuttersControl/Window/Readings.pm
|
||||
UPD 2021-05-17_14:26:04 5159 lib/FHEM/Automation/ShuttersControl/Rainprotection.pm
|
||||
UPD 2021-05-18_08:38:16 5582 lib/FHEM/Automation/ShuttersControl/Rainprotection.pm
|
||||
|
@ -93,6 +93,12 @@ sub RainProcessing {
|
||||
my %funcHash = (
|
||||
shuttersdevice => $shuttersDev,
|
||||
);
|
||||
|
||||
::RemoveInternalTimer($FHEM::Automation::ShuttersControl::shutters->getRainUnprotectionDelayObj)
|
||||
if($FHEM::Automation::ShuttersControl::shutters->getRainUnprotectionDelayObj ne 'none');
|
||||
|
||||
$FHEM::Automation::ShuttersControl::shutters->getRainUnprotectionDelayObj
|
||||
$FHEM::Automation::ShuttersControl::shutters->setRainUnprotectionDelayObj(\%funcHash);
|
||||
|
||||
::InternalTimer( ::gettimeofday() + $FHEM::Automation::ShuttersControl::ascDev->getRainWaitingTime
|
||||
, \&_RainUnprotected
|
||||
|
@ -57,22 +57,6 @@ use strict;
|
||||
use warnings;
|
||||
use utf8;
|
||||
|
||||
use GPUtils qw(GP_Import);
|
||||
|
||||
## Import der FHEM Funktionen
|
||||
BEGIN {
|
||||
GP_Import(
|
||||
qw(
|
||||
defs
|
||||
ReadingsVal
|
||||
readingsSingleUpdate
|
||||
gettimeofday
|
||||
InternalTimer
|
||||
CommandSet
|
||||
Log3)
|
||||
);
|
||||
}
|
||||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $self = {
|
||||
@ -114,15 +98,15 @@ sub setHardLockOut {
|
||||
&& $FHEM::Automation::ShuttersControl::shutters->getLockOutCmd ne
|
||||
'none' )
|
||||
{
|
||||
CommandSet( undef, $self->{shuttersDev} . ' inhibit ' . $cmd )
|
||||
::CommandSet( undef, $self->{shuttersDev} . ' inhibit ' . $cmd )
|
||||
if ( $FHEM::Automation::ShuttersControl::shutters->getLockOutCmd eq
|
||||
'inhibit' );
|
||||
CommandSet( undef,
|
||||
::CommandSet( undef,
|
||||
$self->{shuttersDev} . ' '
|
||||
. ( $cmd eq 'on' ? 'blocked' : 'unblocked' ) )
|
||||
if ( $FHEM::Automation::ShuttersControl::shutters->getLockOutCmd eq
|
||||
'blocked' );
|
||||
CommandSet( undef,
|
||||
::CommandSet( undef,
|
||||
$self->{shuttersDev} . ' '
|
||||
. ( $cmd eq 'on' ? 'protectionOn' : 'protectionOff' ) )
|
||||
if ( $FHEM::Automation::ShuttersControl::shutters->getLockOutCmd eq
|
||||
@ -223,6 +207,12 @@ sub setDriveCmd {
|
||||
. ' - antifreeze mode' );
|
||||
}
|
||||
}
|
||||
|
||||
### Rainprotection unprotected Delay Routine
|
||||
if ( $shutters->getRainUnprotectionDelayObj ne 'none' ) {
|
||||
::Remove::InternalTimer($FHEM::Automation::ShuttersControl::shutters->getRainUnprotectionDelayObj);
|
||||
$FHEM::Automation::ShuttersControl::shutters->setRainUnprotectionDelayObj('none');
|
||||
}
|
||||
|
||||
my %h = (
|
||||
shuttersDev => $self->{shuttersDev},
|
||||
@ -245,8 +235,8 @@ sub setDriveCmd {
|
||||
&& $FHEM::Automation::ShuttersControl::ascDev->getSelfDefense eq
|
||||
'on' )
|
||||
{
|
||||
InternalTimer(
|
||||
gettimeofday() +
|
||||
::InternalTimer(
|
||||
::gettimeofday() +
|
||||
$FHEM::Automation::ShuttersControl::shutters
|
||||
->getSelfDefenseAbsentDelay,
|
||||
\&FHEM::Automation::ShuttersControl::_SetCmdFn, \%h
|
||||
@ -257,8 +247,8 @@ sub setDriveCmd {
|
||||
elsif ( $offSetStart > 0
|
||||
&& !$FHEM::Automation::ShuttersControl::shutters->getNoDelay )
|
||||
{
|
||||
InternalTimer(
|
||||
gettimeofday() + int(
|
||||
::InternalTimer(
|
||||
::gettimeofday() + int(
|
||||
rand($offSet) +
|
||||
$FHEM::Automation::ShuttersControl::shutters
|
||||
->getDelayStart
|
||||
@ -354,14 +344,14 @@ sub setPosSetCmd {
|
||||
|
||||
sub setLastDriveReading {
|
||||
my $self = shift;
|
||||
my $shuttersDevHash = $defs{ $self->{shuttersDev} };
|
||||
my $shuttersDevHash = $::defs{ $self->{shuttersDev} };
|
||||
|
||||
my %h = (
|
||||
devHash => $shuttersDevHash,
|
||||
lastDrive => $FHEM::Automation::ShuttersControl::shutters->getLastDrive,
|
||||
);
|
||||
|
||||
InternalTimer( gettimeofday() + 0.1,
|
||||
::InternalTimer( ::gettimeofday() + 0.1,
|
||||
\&FHEM::Automation::ShuttersControl::_setShuttersLastDriveDelayed,
|
||||
\%h );
|
||||
return;
|
||||
@ -375,7 +365,7 @@ sub setLastPos {
|
||||
|
||||
$self->{ $self->{shuttersDev} }{lastPos}{VAL} = $position
|
||||
if ( defined($position) );
|
||||
$self->{ $self->{shuttersDev} }{lastPos}{TIME} = int( gettimeofday() )
|
||||
$self->{ $self->{shuttersDev} }{lastPos}{TIME} = int( ::gettimeofday() )
|
||||
if ( defined( $self->{ $self->{shuttersDev} }{lastPos} ) );
|
||||
return;
|
||||
}
|
||||
@ -386,11 +376,11 @@ sub setLastManPos {
|
||||
|
||||
$self->{ $self->{shuttersDev} }{lastManPos}{VAL} = $position
|
||||
if ( defined($position) );
|
||||
$self->{ $self->{shuttersDev} }{lastManPos}{TIME} = int( gettimeofday() )
|
||||
$self->{ $self->{shuttersDev} }{lastManPos}{TIME} = int( ::gettimeofday() )
|
||||
if ( defined( $self->{ $self->{shuttersDev} }{lastManPos} )
|
||||
&& defined( $self->{ $self->{shuttersDev} }{lastManPos}{TIME} ) );
|
||||
$self->{ $self->{shuttersDev} }{lastManPos}{TIME} =
|
||||
int( gettimeofday() ) - 86400
|
||||
int( ::gettimeofday() ) - 86400
|
||||
if ( defined( $self->{ $self->{shuttersDev} }{lastManPos} )
|
||||
&& !defined( $self->{ $self->{shuttersDev} }{lastManPos}{TIME} ) );
|
||||
return;
|
||||
@ -472,6 +462,15 @@ sub setRainProtectionStatus { # Werte protected, unprotected
|
||||
return;
|
||||
}
|
||||
|
||||
sub setRainUnprotectionDelayObj {
|
||||
my $self = shift;
|
||||
my $value = shift;
|
||||
|
||||
$self->{ $self->{shuttersDev} }->{RainProtection}->{UNPROTECTIONDELAYOBJVAL} = $value
|
||||
if ( defined($value) );
|
||||
return;
|
||||
}
|
||||
|
||||
sub setExternalTriggerStatus {
|
||||
my $self = shift;
|
||||
my $value = shift;
|
||||
@ -666,7 +665,7 @@ sub getLastDrive {
|
||||
my $self = shift;
|
||||
|
||||
$self->{ $self->{shuttersDev} }{lastDrive} =
|
||||
ReadingsVal( $self->{shuttersDev}, 'ASC_ShuttersLastDrive', 'none' )
|
||||
::ReadingsVal( $self->{shuttersDev}, 'ASC_ShuttersLastDrive', 'none' )
|
||||
if ( !defined( $self->{ $self->{shuttersDev} }{lastDrive} ) );
|
||||
|
||||
return $self->{ $self->{shuttersDev} }{lastDrive};
|
||||
@ -756,6 +755,21 @@ sub getRainProtectionStatus { # Werte protected, unprotected
|
||||
);
|
||||
}
|
||||
|
||||
sub getRainUnprotectionDelayObj {
|
||||
my $self = shift;
|
||||
|
||||
return (
|
||||
(
|
||||
defined( $self->{ $self->{shuttersDev} }->{RainProtection} )
|
||||
&& defined(
|
||||
$self->{ $self->{shuttersDev} }->{RainProtection}->{UNPROTECTIONDELAYOBJVAL}
|
||||
)
|
||||
)
|
||||
? $self->{ $self->{shuttersDev} }->{RainProtection}->{UNPROTECTIONDELAYOBJVAL}
|
||||
: 'none'
|
||||
);
|
||||
}
|
||||
|
||||
sub getSunsetUnixTime {
|
||||
my $self = shift;
|
||||
|
||||
@ -857,7 +871,7 @@ sub getRoommatesLastStatus {
|
||||
sub getOutTemp {
|
||||
my $self = shift;
|
||||
|
||||
return ReadingsVal(
|
||||
return ::ReadingsVal(
|
||||
$FHEM::Automation::ShuttersControl::shutters->_getTempSensor,
|
||||
$FHEM::Automation::ShuttersControl::shutters->getTempSensorReading,
|
||||
-100 );
|
||||
@ -866,7 +880,7 @@ sub getOutTemp {
|
||||
sub getIdleDetection {
|
||||
my $self = shift;
|
||||
|
||||
return ReadingsVal(
|
||||
return ::ReadingsVal(
|
||||
$self->{shuttersDev},
|
||||
$FHEM::Automation::ShuttersControl::shutters->_getIdleDetectionReading,
|
||||
'none'
|
||||
@ -891,7 +905,7 @@ sub setShadingStatus {
|
||||
|
||||
$self->{ $self->{shuttersDev} }{ShadingStatus}{VAL} = $value
|
||||
if ( defined($value) );
|
||||
$self->{ $self->{shuttersDev} }{ShadingStatus}{TIME} = int( gettimeofday() )
|
||||
$self->{ $self->{shuttersDev} }{ShadingStatus}{TIME} = int( ::gettimeofday() )
|
||||
if ( defined( $self->{ $self->{shuttersDev} }{ShadingStatus} ) );
|
||||
|
||||
return;
|
||||
@ -909,7 +923,7 @@ sub setShadingLastStatus {
|
||||
$self->{ $self->{shuttersDev} }{ShadingLastStatus}{VAL} = $value
|
||||
if ( defined($value) );
|
||||
$self->{ $self->{shuttersDev} }{ShadingLastStatus}{TIME} =
|
||||
int( gettimeofday() )
|
||||
int( ::gettimeofday() )
|
||||
if ( defined( $self->{ $self->{shuttersDev} }{ShadingLastStatus} ) );
|
||||
$self->{ $self->{shuttersDev} }{ShadingManualDriveStatus}{VAL} = 0
|
||||
if ( $value eq 'out' );
|
||||
|
Loading…
Reference in New Issue
Block a user