fix little bug

This commit is contained in:
Marko Oldenburg
2019-11-04 14:39:55 +01:00
parent 81f610374a
commit 3121e88fb2

View File

@@ -1046,13 +1046,11 @@ sub EventProcessingWindowRec($@) {
} }
} }
elsif ( elsif (
$shutters->getModeUp ne 'absent' $shutters->getModeDown ne 'absent'
and $shutters->getModeUp ne 'off' and $shutters->getModeDown ne 'off'
and ( not $shutters->getIsDay and ( not $shutters->getIsDay
or $homemode eq 'asleep' or $homemode eq 'asleep'
or $homemode eq 'gotosleep' ) or $homemode eq 'gotosleep' )
and $shutters->getModeDown ne 'absent'
and $shutters->getModeDown ne 'off'
and $ascDev->getAutoShuttersControlEvening eq 'on' and $ascDev->getAutoShuttersControlEvening eq 'on'
) )
{ {
@@ -3073,6 +3071,9 @@ sub CreateNewNotifyDev($) {
AddNotifyDev( $hash, AttrVal( $_, 'ASC_BrightnessSensor', 'none' ), AddNotifyDev( $hash, AttrVal( $_, 'ASC_BrightnessSensor', 'none' ),
$_, 'ASC_BrightnessSensor' ) $_, 'ASC_BrightnessSensor' )
if ( AttrVal( $_, 'ASC_BrightnessSensor', 'none' ) ne 'none' ); if ( AttrVal( $_, 'ASC_BrightnessSensor', 'none' ) ne 'none' );
AddNotifyDev( $hash, AttrVal( $_, 'ASC_ExternalTriggerDevice', 'none' ),
$_, 'ASC_BrightnessSensor' )
if ( AttrVal( $_, 'ASC_ExternalTriggerDevice', 'none' ) ne 'none' );
$shuttersList = $shuttersList . ',' . $_; $shuttersList = $shuttersList . ',' . $_;
} }
@@ -5448,143 +5449,143 @@ sub getShadingWaitingPeriod {
sub getExternalTriggerDevice { sub getExternalTriggerDevice {
my $self = shift; my $self = shift;
return $self->{ $self->{shuttersDev} } return $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}
->{ASC_ExternalTriggerDevice}->{device} ->{device}
if ( if (
exists( exists(
$self->{ $self->{shuttersDev} } $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}
->{ASC_ExternalTriggerDevice}->{LASTGETTIME} ->{LASTGETTIME}
) )
and ( gettimeofday() - and ( gettimeofday() -
$self->{ $self->{shuttersDev} }
->{ASC_ExternalTriggerDevice}->{LASTGETTIME} ) < 2
);
$self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice} $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}
->{LASTGETTIME} = int( gettimeofday() ); ->{LASTGETTIME} ) < 2
my ( $device, $reading, $valueActive, $valueInactive, $posActive, $posInactive ) = );
FHEM::AutoShuttersControl::GetAttrValues( $self->{shuttersDev}, $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}->{LASTGETTIME}
'ASC_ExternalTriggerDevice', = int( gettimeofday() );
'none' ); my ( $device, $reading, $valueActive, $valueInactive, $posActive,
$posInactive )
= FHEM::AutoShuttersControl::GetAttrValues( $self->{shuttersDev},
'ASC_ExternalTriggerDevice', 'none' );
### erwartetes Ergebnis ### erwartetes Ergebnis
# DEVICE:READING VALUEACTIVE:VALUEINACTIVE POSACTIVE:POSINACTIVE # DEVICE:READING VALUEACTIVE:VALUEINACTIVE POSACTIVE:POSINACTIVE
$self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice} $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}->{device} =
->{device} = $device; $device;
$self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice} $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}->{reading} =
->{reading} = $reading; $reading;
$self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice} $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}->{valueactive}
->{valueactive} = $valueActive; = $valueActive;
$self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice} $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}
->{valueinactive} = $valueInactive; ->{valueinactive} = $valueInactive;
$self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice} $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}->{posactive} =
->{posactive} = $posActive; $posActive;
$self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice} $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}->{posinactive}
->{posinactive} = $posInactive; = $posInactive;
return $self->{ $self->{shuttersDev} } return $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}
->{ASC_ExternalTriggerDevice}->{device}; ->{device};
} }
sub getExternalTriggerReading { sub getExternalTriggerReading {
my $self = shift; my $self = shift;
return $self->{ $self->{shuttersDev} } return $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}
->{ASC_ExternalTriggerDevice}->{reading} ->{reading}
if ( if (
exists( exists(
$self->{ $self->{shuttersDev} } $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}
->{ASC_ExternalTriggerDevice}->{LASTGETTIME} ->{LASTGETTIME}
) )
and ( gettimeofday() - and ( gettimeofday() -
$self->{ $self->{shuttersDev} } $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}
->{ASC_ExternalTriggerDevice}->{LASTGETTIME} ) < 2 ->{LASTGETTIME} ) < 2
); );
$shutters->getExternalTriggerDevice; $shutters->getExternalTriggerDevice;
return $self->{ $self->{shuttersDev} } return $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}
->{ASC_ExternalTriggerDevice}->{reading}; ->{reading};
} }
sub getExternalTriggerValueActive { sub getExternalTriggerValueActive {
my $self = shift; my $self = shift;
return $self->{ $self->{shuttersDev} } return $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}
->{ASC_ExternalTriggerDevice}->{valueactive} ->{valueactive}
if ( if (
exists( exists(
$self->{ $self->{shuttersDev} } $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}
->{ASC_ExternalTriggerDevice}->{LASTGETTIME} ->{LASTGETTIME}
) )
and ( gettimeofday() - and ( gettimeofday() -
$self->{ $self->{shuttersDev} } $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}
->{ASC_ExternalTriggerDevice}->{LASTGETTIME} ) < 2 ->{LASTGETTIME} ) < 2
); );
$shutters->getExternalTriggerDevice; $shutters->getExternalTriggerDevice;
return $self->{ $self->{shuttersDev} } return $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}
->{ASC_ExternalTriggerDevice}->{valueactive}; ->{valueactive};
} }
sub getExternalTriggerValueInactive { sub getExternalTriggerValueInactive {
my $self = shift; my $self = shift;
return $self->{ $self->{shuttersDev} } return $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}
->{ASC_ExternalTriggerDevice}->{valueinactive} ->{valueinactive}
if ( if (
exists( exists(
$self->{ $self->{shuttersDev} } $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}
->{ASC_ExternalTriggerDevice}->{LASTGETTIME} ->{LASTGETTIME}
) )
and ( gettimeofday() - and ( gettimeofday() -
$self->{ $self->{shuttersDev} } $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}
->{ASC_ExternalTriggerDevice}->{LASTGETTIME} ) < 2 ->{LASTGETTIME} ) < 2
); );
$shutters->getExternalTriggerDevice; $shutters->getExternalTriggerDevice;
return $self->{ $self->{shuttersDev} } return $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}
->{ASC_ExternalTriggerDevice}->{valueinactive}; ->{valueinactive};
} }
sub getExternalTriggerPosActive { sub getExternalTriggerPosActive {
my $self = shift; my $self = shift;
return $self->{ $self->{shuttersDev} } return $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}
->{ASC_ExternalTriggerDevice}->{posactive} ->{posactive}
if ( if (
exists( exists(
$self->{ $self->{shuttersDev} } $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}
->{ASC_ExternalTriggerDevice}->{LASTGETTIME} ->{LASTGETTIME}
) )
and ( gettimeofday() - and ( gettimeofday() -
$self->{ $self->{shuttersDev} } $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}
->{ASC_ExternalTriggerDevice}->{LASTGETTIME} ) < 2 ->{LASTGETTIME} ) < 2
); );
$shutters->getExternalTriggerDevice; $shutters->getExternalTriggerDevice;
return $self->{ $self->{shuttersDev} } return $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}
->{ASC_ExternalTriggerDevice}->{posactive}; ->{posactive};
} }
sub getExternalTriggerPosInactive { sub getExternalTriggerPosInactive {
my $self = shift; my $self = shift;
return $self->{ $self->{shuttersDev} } return $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}
->{ASC_ExternalTriggerDevice}->{posinactive} ->{posinactive}
if ( if (
exists( exists(
$self->{ $self->{shuttersDev} } $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}
->{ASC_ExternalTriggerDevice}->{LASTGETTIME} ->{LASTGETTIME}
) )
and ( gettimeofday() - and ( gettimeofday() -
$self->{ $self->{shuttersDev} } $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}
->{ASC_ExternalTriggerDevice}->{LASTGETTIME} ) < 2 ->{LASTGETTIME} ) < 2
); );
$shutters->getExternalTriggerDevice; $shutters->getExternalTriggerDevice;
return $self->{ $self->{shuttersDev} } return $self->{ $self->{shuttersDev} }->{ASC_ExternalTriggerDevice}
->{ASC_ExternalTriggerDevice}->{posinactive}; ->{posinactive};
} }
sub getDelay { sub getDelay {