add more conditions to delaydrive

This commit is contained in:
Marko Oldenburg 2019-09-20 14:03:13 +02:00
parent ce425067b7
commit e76092fce4

View File

@ -2414,9 +2414,12 @@ sub ShuttersCommandSet($$$) {
if (
$posValue != $shutters->getShadingPos
or ( $posValue == $shutters->getShadingPos
or (
$posValue == $shutters->getShadingPos
and CheckIfShuttersWindowRecOpen($shuttersDev) == 2
and $shutters->getShuttersPlace eq 'terrace'
and ( $shutters->getLockOut eq 'soft'
or $shutters->getLockOut eq 'hard' )
)
and (
(
@ -3770,7 +3773,8 @@ sub _SetCmdFn($) {
if ( defined( $h->{lastDrive} ) );
return
unless ( $shutters->getASCenable eq 'on'
unless (
$shutters->getASCenable eq 'on'
and $ascDev->getASCenable eq 'on'
and ( $idleDetection =~ /^$idleDetectionValue$/
or $idleDetection eq 'none' )
@ -4719,27 +4723,32 @@ sub getTempSensorReading {
sub _getIdleDetectionReading {
my $self = shift;
return $self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}->{reading}
return $self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}
->{reading}
if (
exists(
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}->{LASTGETTIME}
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}
->{LASTGETTIME}
)
and ( gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}->{LASTGETTIME} )
< 2
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}
->{LASTGETTIME} ) < 2
);
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}->{LASTGETTIME} =
int( gettimeofday() );
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}->{LASTGETTIME}
= int( gettimeofday() );
my ( $reading, $value ) =
FHEM::AutoShuttersControl::GetAttrValues( $self->{shuttersDev},
'ASC_Shutter_IdleDetection', 'none' );
### erwartetes Ergebnis
# READING:VALUE
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}->{reading} = $reading;
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}->{value} = $value;
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}->{reading} =
$reading;
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}->{value} =
$value;
return $self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}->{reading};
return $self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}
->{reading};
}
sub getIdleDetectionValue {
@ -4748,16 +4757,20 @@ sub getIdleDetectionValue {
return $self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}->{value}
if (
exists(
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}->{LASTGETTIME}
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}
->{LASTGETTIME}
)
and ( gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}->{LASTGETTIME} )
< 2
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}
->{LASTGETTIME} ) < 2
);
$shutters->_getIdleDetectionReading;
return (
defined( $self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}->{value} )
defined(
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}
->{value}
)
? $self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}->{value}
: 'none'
);