2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

73_AutoShuttersControl: fix bug then create timer, timer set to 1970

git-svn-id: https://svn.fhem.de/fhem/trunk@18652 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
LeonGaultier 2019-02-19 20:20:44 +00:00
parent 7a0d75e4d4
commit 7a56a0ec7d
2 changed files with 18 additions and 12 deletions

View File

@ -1,5 +1,7 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it. # Do not insert empty lines here, update check depends on it.
- bugfix 73_AutoShuttersControl: fix bug then create timer, timer set to
1970
- new: 98_serviced: new modul for linux services (systemd and initd) - new: 98_serviced: new modul for linux services (systemd and initd)
- bugfix: 12_HProtocolGateway: start poll timer - bugfix: 12_HProtocolGateway: start poll timer
- bugfix: 73_AutoShuttersControl: fix many bugs, support for max window - bugfix: 73_AutoShuttersControl: fix many bugs, support for max window

View File

@ -41,7 +41,7 @@ package main;
use strict; use strict;
use warnings; use warnings;
my $version = '0.4.0.4'; my $version = '0.4.0.5';
sub AutoShuttersControl_Initialize($) { sub AutoShuttersControl_Initialize($) {
my ($hash) = @_; my ($hash) = @_;
@ -1184,9 +1184,12 @@ sub EventProcessingBrightness($@) {
if ( $homemode eq 'none' ); if ( $homemode eq 'none' );
$shutters->setLastDrive('maximum brightness threshold exceeded'); $shutters->setLastDrive('maximum brightness threshold exceeded');
if ( $shutters->getModeUp eq $homemode if (
or $homemode eq 'none' $shutters->getModeUp eq $homemode
or $shutters->getModeUp eq 'always' ) or ( $shutters->getModeUp eq 'absent'
and $homemode eq 'gone' )
or $shutters->getModeUp eq 'always'
)
{ {
if ( if (
( (
@ -1245,9 +1248,12 @@ sub EventProcessingBrightness($@) {
if ( $homemode eq 'none' ); if ( $homemode eq 'none' );
$shutters->setLastDrive('minimum brightness threshold fell below'); $shutters->setLastDrive('minimum brightness threshold fell below');
if ( $shutters->getModeDown eq $homemode if (
or $homemode eq 'none' $shutters->getModeUp eq $homemode
or $shutters->getModeDown eq 'always' ) or ( $shutters->getModeUp eq 'absent'
and $homemode eq 'gone' )
or $shutters->getModeUp eq 'always'
)
{ {
ShuttersCommandSet( $hash, $shuttersDev, $posValue ); ShuttersCommandSet( $hash, $shuttersDev, $posValue );
} }
@ -1604,8 +1610,7 @@ sub CreateSunRiseSetShuttersTimer($$) {
"%e.%m.%Y - %H:%M", localtime($shuttersSunsetUnixtime) "%e.%m.%Y - %H:%M", localtime($shuttersSunsetUnixtime)
) )
: 'AutoShuttersControl off' : 'AutoShuttersControl off'
), )
1
); );
readingsBulkUpdate( readingsBulkUpdate(
$shuttersDevHash, $shuttersDevHash,
@ -1615,10 +1620,9 @@ sub CreateSunRiseSetShuttersTimer($$) {
? strftime( "%e.%m.%Y - %H:%M", ? strftime( "%e.%m.%Y - %H:%M",
localtime($shuttersSunriseUnixtime) ) localtime($shuttersSunriseUnixtime) )
: 'AutoShuttersControl off' : 'AutoShuttersControl off'
), )
1
); );
readingsEndUpdate( $shuttersDevHash, 1 ); readingsEndUpdate( $shuttersDevHash, 0 );
readingsBeginUpdate($hash); readingsBeginUpdate($hash);
readingsBulkUpdateIfChanged( readingsBulkUpdateIfChanged(