change getMode logic
This commit is contained in:
@@ -41,7 +41,7 @@ package main;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my $version = '0.4.0.9';
|
||||
my $version = '0.4.0.10';
|
||||
|
||||
sub AutoShuttersControl_Initialize($) {
|
||||
my ($hash) = @_;
|
||||
@@ -886,9 +886,10 @@ sub EventProcessingRoommate($@) {
|
||||
and ( $shutters->getRoommatesStatus eq 'home'
|
||||
or $shutters->getRoommatesStatus eq 'awoken' )
|
||||
and $ascDev->getAutoShuttersControlMorning eq 'on'
|
||||
|
||||
and ( $shutters->getModeUp eq 'always'
|
||||
or $shutters->getModeUp eq 'home' )
|
||||
and ( $shutters->getModeUp eq 'home'
|
||||
or $shutters->getModeUp eq 'always'
|
||||
or $shutters->getModeDown eq 'home'
|
||||
or $shutters->getModeDown eq 'always' )
|
||||
)
|
||||
{
|
||||
Log3( $name, 4,
|
||||
@@ -901,6 +902,8 @@ sub EventProcessingRoommate($@) {
|
||||
)
|
||||
and IsDay( $hash, $shuttersDev )
|
||||
and IsAfterShuttersTimeBlocking( $hash, $shuttersDev )
|
||||
and ( $shutters->getModeUp eq 'home'
|
||||
or $shutters->getModeUp eq 'always' )
|
||||
)
|
||||
{
|
||||
Log3( $name, 4,
|
||||
@@ -917,15 +920,14 @@ sub EventProcessingRoommate($@) {
|
||||
or $shutters->getRoommatesLastStatus eq 'gone'
|
||||
or $shutters->getRoommatesLastStatus eq 'home'
|
||||
)
|
||||
and ( $shutters->getModeUp eq 'home'
|
||||
or $shutters->getModeUp eq 'always'
|
||||
or $shutters->getModeDown eq 'home'
|
||||
or $shutters->getModeDown eq 'always' )
|
||||
and $shutters->getRoommatesStatus eq 'home'
|
||||
)
|
||||
{
|
||||
if ( not IsDay( $hash, $shuttersDev )
|
||||
and IsAfterShuttersTimeBlocking( $hash, $shuttersDev ) )
|
||||
and IsAfterShuttersTimeBlocking( $hash, $shuttersDev )
|
||||
and ( $shutters->getModeDown eq 'home'
|
||||
or $shutters->getModeDown eq 'always' )
|
||||
)
|
||||
{
|
||||
my $position;
|
||||
$shutters->setLastDrive('roommate home');
|
||||
@@ -945,7 +947,9 @@ sub EventProcessingRoommate($@) {
|
||||
}
|
||||
elsif ( IsDay( $hash, $shuttersDev )
|
||||
and $shutters->getStatus == $shutters->getClosedPos
|
||||
and IsAfterShuttersTimeBlocking( $hash, $shuttersDev ) )
|
||||
and IsAfterShuttersTimeBlocking( $hash, $shuttersDev )
|
||||
and ( $shutters->getModeUp eq 'home'
|
||||
or $shutters->getModeUp eq 'always') )
|
||||
{
|
||||
$shutters->setLastDrive('roommate home');
|
||||
ShuttersCommandSet( $hash, $shuttersDev,
|
||||
|
Reference in New Issue
Block a user