change wind control logic
This commit is contained in:
parent
e8018b0c60
commit
3f15c32d7b
@ -41,7 +41,7 @@ package main;
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
my $version = '0.4.0.11beta37';
|
my $version = '0.4.0.11beta42';
|
||||||
|
|
||||||
sub AutoShuttersControl_Initialize($) {
|
sub AutoShuttersControl_Initialize($) {
|
||||||
my ($hash) = @_;
|
my ($hash) = @_;
|
||||||
@ -1170,24 +1170,25 @@ sub EventProcessingWind($@) {
|
|||||||
if ( $events =~ m#$reading:\s(\d+)# ) {
|
if ( $events =~ m#$reading:\s(\d+)# ) {
|
||||||
foreach my $shuttersDev ( @{ $hash->{helper}{shuttersList} } ) {
|
foreach my $shuttersDev ( @{ $hash->{helper}{shuttersList} } ) {
|
||||||
$shutters->setShuttersDev($shuttersDev);
|
$shutters->setShuttersDev($shuttersDev);
|
||||||
|
$shutters->setWindProtection('unprotection') if ( not defined($shutters->getWindPos) );
|
||||||
next if ( $shutters->getWindMax < 0 );
|
next if ( $shutters->getWindMax < 0 );
|
||||||
next if ( CheckIfShuttersWindowRecOpen($shuttersDev) != 0
|
next if ( CheckIfShuttersWindowRecOpen($shuttersDev) != 0
|
||||||
and $shutters->getShuttersPlace eq 'terrace' );
|
and $shutters->getShuttersPlace eq 'terrace' );
|
||||||
|
|
||||||
if ( $1 > $shutters->getWindMax
|
if ( $1 > $shutters->getWindMax
|
||||||
and $shutters->getStatus !=
|
and $shutters->getWindProtection eq 'unprotection' )
|
||||||
$shutters->getWindPos )
|
|
||||||
{
|
{
|
||||||
$shutters->setLastDrive('wind protection');
|
$shutters->setLastDrive('wind protection');
|
||||||
$shutters->setDriveCmd(
|
$shutters->setDriveCmd(
|
||||||
$shutters->getWindPos );
|
$shutters->getWindPos );
|
||||||
|
$shutters->setWindProtection('protection');
|
||||||
}
|
}
|
||||||
elsif ( $1 < $shutters->getWindMin
|
elsif ( $1 < $shutters->getWindMin
|
||||||
and $shutters->getStatus ==
|
and $shutters->getWindProtection eq 'protection' )
|
||||||
$shutters->getWindPos )
|
|
||||||
{
|
{
|
||||||
$shutters->setLastDrive('wind un-protection');
|
$shutters->setLastDrive('wind un-protection');
|
||||||
$shutters->setDriveCmd( $shutters->getLastPos );
|
$shutters->setDriveCmd( $shutters->getLastPos );
|
||||||
|
$shutters->setWindProtection('unprotection');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2973,6 +2974,14 @@ sub setShading {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub setWindProtection { # Werte protection, unprotection
|
||||||
|
my ( $self, $value ) = @_;
|
||||||
|
|
||||||
|
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{VAL} = $value
|
||||||
|
if ( defined($value) );
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
sub getShading { # Werte für value = in, out, in reserved, out reserved
|
sub getShading { # Werte für value = in, out, in reserved, out reserved
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
@ -2981,6 +2990,14 @@ sub getShading { # Werte für value = in, out, in reserved, out reserved
|
|||||||
and defined( $self->{ $self->{shuttersDev} }{Shading}{VAL} ) );
|
and defined( $self->{ $self->{shuttersDev} }{Shading}{VAL} ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub getWindProtection { # Werte protection, unprotection
|
||||||
|
my $self = shift;
|
||||||
|
|
||||||
|
return $self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{VAL}
|
||||||
|
if ( defined( $self->{ $self->{shuttersDev} }->{ASC_WindParameters} )
|
||||||
|
and defined( $self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{VAL} ) );
|
||||||
|
}
|
||||||
|
|
||||||
sub getShadingTimestamp {
|
sub getShadingTimestamp {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user