fix bug in brightnessUpDown ASC Attr

This commit is contained in:
Marko Oldenburg 2019-04-20 18:18:50 +02:00
parent 657e4879d9
commit 047e9cdf6f

View File

@ -2185,23 +2185,18 @@ sub SunSetShuttersAfterTimerFn($) {
? $shutters->getStatus > $shutters->getPrivacyDownPos ? $shutters->getStatus > $shutters->getPrivacyDownPos
: $shutters->getStatus < $shutters->getPrivacyDownPos : $shutters->getStatus < $shutters->getPrivacyDownPos
); );
if ( $funcHash->{privacyMode} == 1 if ( $funcHash->{privacyMode} == 1
and not $queryShuttersPosPrivacyDown ) and not $queryShuttersPosPrivacyDown )
{ {
$shutters->setLastDrive('privacy position'); $shutters->setLastDrive('privacy position');
ShuttersCommandSet( ShuttersCommandSet( $hash, $shuttersDev,
$hash,
$shuttersDev,
$shutters->getPrivacyDownPos ); $shutters->getPrivacyDownPos );
} }
elsif ( $funcHash->{privacyMode} == 0 ) { elsif ( $funcHash->{privacyMode} == 0 ) {
$shutters->setSunset(1); $shutters->setSunset(1);
$shutters->setLastDrive('night close'); $shutters->setLastDrive('night close');
ShuttersCommandSet( ShuttersCommandSet( $hash, $shuttersDev, $posValue );
$hash,
$shuttersDev,
$posValue );
} }
} }
@ -3394,7 +3389,8 @@ sub getSunset {
return ( return (
defined( $self->{ $self->{shuttersDev} }{sunset} ) defined( $self->{ $self->{shuttersDev} }{sunset} )
? $self->{ $self->{shuttersDev} }{sunset} ? $self->{ $self->{shuttersDev} }{sunset}
: 0 ); : 0
);
} }
sub getSunriseUnixTime { sub getSunriseUnixTime {
@ -3409,7 +3405,8 @@ sub getSunrise {
return ( return (
defined( $self->{ $self->{shuttersDev} }{sunrise} ) defined( $self->{ $self->{shuttersDev} }{sunrise} )
? $self->{ $self->{shuttersDev} }{sunrise} ? $self->{ $self->{shuttersDev} }{sunrise}
: 0 ); : 0
);
} }
sub getRoommatesStatus { sub getRoommatesStatus {
@ -4365,7 +4362,6 @@ sub getBrightnessMinVal {
return $self->{ASC_brightness}->{triggermin} return $self->{ASC_brightness}->{triggermin}
if ( exists( $self->{ASC_brightness}->{LASTGETTIME} ) if ( exists( $self->{ASC_brightness}->{LASTGETTIME} )
and ( gettimeofday() - $self->{ASC_brightness}->{LASTGETTIME} ) < 2 ); and ( gettimeofday() - $self->{ASC_brightness}->{LASTGETTIME} ) < 2 );
$self->{ASC_brightness}->{LASTGETTIME} = int( gettimeofday() );
$ascDev->getBrightnessMaxVal; $ascDev->getBrightnessMaxVal;
return $self->{ASC_brightness}->{triggermin}; return $self->{ASC_brightness}->{triggermin};
@ -4379,6 +4375,7 @@ sub getBrightnessMaxVal {
if ( exists( $self->{ASC_brightness}->{LASTGETTIME} ) if ( exists( $self->{ASC_brightness}->{LASTGETTIME} )
and ( gettimeofday() - $self->{ASC_brightness}->{LASTGETTIME} ) < 2 ); and ( gettimeofday() - $self->{ASC_brightness}->{LASTGETTIME} ) < 2 );
$self->{ASC_brightness}->{LASTGETTIME} = int( gettimeofday() ); $self->{ASC_brightness}->{LASTGETTIME} = int( gettimeofday() );
my ( $triggermax, $triggermin ) = my ( $triggermax, $triggermin ) =
FHEM::AutoShuttersControl::GetAttrValues( $name, FHEM::AutoShuttersControl::GetAttrValues( $name,
'ASC_brightnessDriveUpDown', 'none' ); 'ASC_brightnessDriveUpDown', 'none' );
@ -4635,7 +4632,8 @@ sub getWindSensorReading {
return ( return (
defined( $self->{ASC_windSensor}->{reading} ) defined( $self->{ASC_windSensor}->{reading} )
? $self->{ASC_windSensor}->{reading} ? $self->{ASC_windSensor}->{reading}
: 'wind' ); : 'wind'
);
} }
sub getblockAscDrivesAfterManual { sub getblockAscDrivesAfterManual {