split shadingProcessing function into two functions
This commit is contained in:
parent
bf9a64ed56
commit
776ac58815
@ -1729,6 +1729,12 @@ sub EventProcessingShadingBrightness($@) {
|
|||||||
. ' - Alle Bedingungen zur weiteren Beschattungsverarbeitung sind erfüllt. Es wird nun die eigentliche Beschattungsfunktion aufgerufen'
|
. ' - Alle Bedingungen zur weiteren Beschattungsverarbeitung sind erfüllt. Es wird nun die eigentliche Beschattungsfunktion aufgerufen'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
# else {
|
||||||
|
# unless ( $shutters->getShadingMode eq $homemode
|
||||||
|
# and
|
||||||
|
# $shutters->setShadingStatus('out');
|
||||||
|
# ShadingProcessingDriveCommand($hash,$shuttersDev);
|
||||||
|
# }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1988,81 +1994,90 @@ sub ShadingProcessing($@) {
|
|||||||
. ' Neuer Status: '
|
. ' Neuer Status: '
|
||||||
. $shutters->getShadingStatus );
|
. $shutters->getShadingStatus );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ShadingProcessingDriveCommand($hash,$shuttersDev)
|
||||||
|
if ( $shutters->getShadingStatus eq 'out'
|
||||||
|
or $shutters->getShadingStatus eq 'in' );
|
||||||
|
}
|
||||||
|
|
||||||
if ( $shutters->getShadingStatus eq 'out'
|
sub ShadingProcessingDriveCommand($$) {
|
||||||
or $shutters->getShadingStatus eq 'in' )
|
my ($hash,$shuttersDev) = @_;
|
||||||
|
|
||||||
|
my $name = $hash->{NAME};
|
||||||
|
$shutters->setShuttersDev($shuttersDev);
|
||||||
|
|
||||||
|
my $getShadingPos = $shutters->getShadingPos;
|
||||||
|
my $getStatus = $shutters->getStatus;
|
||||||
|
|
||||||
|
$shutters->setShadingStatus( $shutters->getShadingStatus )
|
||||||
|
if (
|
||||||
|
( int( gettimeofday() ) - $shutters->getShadingStatusTimestamp ) >
|
||||||
|
( $shutters->getShadingWaitingPeriod / 2 ) );
|
||||||
|
|
||||||
|
if ( $shutters->getShadingStatus eq 'in'
|
||||||
|
and $getShadingPos != $getStatus )
|
||||||
{
|
{
|
||||||
### Erstmal rausgenommen könnte Grund für nicht mehr reinfahren in die Beschattung sein
|
my $queryShuttersShadingPos = (
|
||||||
$shutters->setShadingStatus( $shutters->getShadingStatus )
|
$shutters->getShuttersPosCmdValueNegate
|
||||||
if (
|
? $getStatus > $getShadingPos
|
||||||
( int( gettimeofday() ) - $shutters->getShadingStatusTimestamp ) >
|
: $getStatus < $getShadingPos
|
||||||
( $shutters->getShadingWaitingPeriod / 2 ) );
|
);
|
||||||
|
|
||||||
if ( $shutters->getShadingStatus eq 'in'
|
if (
|
||||||
and $getShadingPos != $getStatus )
|
not $queryShuttersShadingPos
|
||||||
|
and not( CheckIfShuttersWindowRecOpen($shuttersDev) == 2
|
||||||
|
and $shutters->getShuttersPlace eq 'terrace' )
|
||||||
|
)
|
||||||
{
|
{
|
||||||
my $queryShuttersShadingPos = (
|
$shutters->setLastDrive('shading in');
|
||||||
$shutters->getShuttersPosCmdValueNegate
|
ShuttersCommandSet( $hash, $shuttersDev, $getShadingPos );
|
||||||
? $getStatus > $getShadingPos
|
|
||||||
: $getStatus < $getShadingPos
|
|
||||||
);
|
|
||||||
|
|
||||||
if (
|
|
||||||
not $queryShuttersShadingPos
|
|
||||||
and not( CheckIfShuttersWindowRecOpen($shuttersDev) == 2
|
|
||||||
and $shutters->getShuttersPlace eq 'terrace' )
|
|
||||||
)
|
|
||||||
{
|
|
||||||
$shutters->setLastDrive('shading in');
|
|
||||||
ShuttersCommandSet( $hash, $shuttersDev, $getShadingPos );
|
|
||||||
|
|
||||||
ASC_Debug( 'ShadingProcessing: '
|
|
||||||
. $shutters->getShuttersDev
|
|
||||||
. ' - Der aktuelle Beschattungsstatus ist: '
|
|
||||||
. $shutters->getShadingStatus
|
|
||||||
. ' und somit wird nun in die Position: '
|
|
||||||
. $getShadingPos
|
|
||||||
. ' zum Beschatten gefahren' );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
elsif ( $shutters->getShadingStatus eq 'out'
|
|
||||||
and $getShadingPos == $getStatus )
|
|
||||||
{
|
|
||||||
$shutters->setLastDrive('shading out');
|
|
||||||
ShuttersCommandSet(
|
|
||||||
$hash,
|
|
||||||
$shuttersDev,
|
|
||||||
(
|
|
||||||
$shutters->getShadingPos == $shutters->getLastPos
|
|
||||||
? $shutters->getOpenPos
|
|
||||||
: $shutters->getLastPos
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
ASC_Debug( 'ShadingProcessing: '
|
ASC_Debug( 'ShadingProcessing: '
|
||||||
. $shutters->getShuttersDev
|
. $shutters->getShuttersDev
|
||||||
. ' - Der aktuelle Beschattungsstatus ist: '
|
. ' - Der aktuelle Beschattungsstatus ist: '
|
||||||
. $shutters->getShadingStatus
|
. $shutters->getShadingStatus
|
||||||
. ' und somit wird nun in die Position: '
|
. ' und somit wird nun in die Position: '
|
||||||
. $getShadingPos
|
. $getShadingPos
|
||||||
. ' zum beenden der Beschattung gefahren' );
|
. ' zum Beschatten gefahren' );
|
||||||
}
|
}
|
||||||
|
|
||||||
Log3( $name, 4,
|
|
||||||
"AutoShuttersControl ($name) - Shading Processing - In der Routine zum fahren der Rollläden, Shading Wert: "
|
|
||||||
. $shutters->getShadingStatus );
|
|
||||||
|
|
||||||
ASC_Debug(
|
|
||||||
'ShadingProcessing: '
|
|
||||||
. $shutters->getShuttersDev
|
|
||||||
. ' - Der aktuelle Beschattungsstatus ist: '
|
|
||||||
. $shutters->getShadingStatus
|
|
||||||
. ', Beschattungsstatus Zeitstempel: '
|
|
||||||
. strftime(
|
|
||||||
"%Y.%m.%e %T", localtime( $shutters->getShadingStatusTimestamp )
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
elsif ( $shutters->getShadingStatus eq 'out'
|
||||||
|
and $getShadingPos == $getStatus )
|
||||||
|
{
|
||||||
|
$shutters->setLastDrive('shading out');
|
||||||
|
ShuttersCommandSet(
|
||||||
|
$hash,
|
||||||
|
$shuttersDev,
|
||||||
|
(
|
||||||
|
$shutters->getShadingPos == $shutters->getLastPos
|
||||||
|
? $shutters->getOpenPos
|
||||||
|
: $shutters->getLastPos
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
ASC_Debug( 'ShadingProcessing: '
|
||||||
|
. $shutters->getShuttersDev
|
||||||
|
. ' - Der aktuelle Beschattungsstatus ist: '
|
||||||
|
. $shutters->getShadingStatus
|
||||||
|
. ' und somit wird nun in die Position: '
|
||||||
|
. $getShadingPos
|
||||||
|
. ' zum beenden der Beschattung gefahren' );
|
||||||
|
}
|
||||||
|
|
||||||
|
Log3( $name, 4,
|
||||||
|
"AutoShuttersControl ($name) - Shading Processing - In der Routine zum fahren der Rollläden, Shading Wert: "
|
||||||
|
. $shutters->getShadingStatus );
|
||||||
|
|
||||||
|
ASC_Debug(
|
||||||
|
'ShadingProcessing: '
|
||||||
|
. $shutters->getShuttersDev
|
||||||
|
. ' - Der aktuelle Beschattungsstatus ist: '
|
||||||
|
. $shutters->getShadingStatus
|
||||||
|
. ', Beschattungsstatus Zeitstempel: '
|
||||||
|
. strftime(
|
||||||
|
"%Y.%m.%e %T", localtime( $shutters->getShadingStatusTimestamp )
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub EventProcessingPartyMode($) {
|
sub EventProcessingPartyMode($) {
|
||||||
@ -2495,6 +2510,7 @@ sub SunRiseShuttersAfterTimerFn($) {
|
|||||||
or ( $ascDev->getSelfDefense eq 'on'
|
or ( $ascDev->getSelfDefense eq 'on'
|
||||||
and CheckIfShuttersWindowRecOpen($shuttersDev) == 0 )
|
and CheckIfShuttersWindowRecOpen($shuttersDev) == 0 )
|
||||||
)
|
)
|
||||||
|
and $shutters->getShadingStatus ne 'in'
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$shutters->setLastDrive('day open');
|
$shutters->setLastDrive('day open');
|
||||||
|
Loading…
Reference in New Issue
Block a user