2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

RESIDENTStk wakeuptimer: fix at-timer begin calculation for OFF-timers

git-svn-id: https://svn.fhem.de/fhem/trunk@8213 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
jpawlowski 2015-03-14 16:40:37 +00:00
parent 5a1b1587c4
commit f36401e7c8

View File

@ -281,8 +281,7 @@ if (\$EVTPART0 eq \"stop\") {\
&& defined( $defs{$wakeupAtdevice} ) && defined( $defs{$wakeupAtdevice} )
&& $defs{$wakeupAtdevice}{TYPE} eq "at" ) && $defs{$wakeupAtdevice}{TYPE} eq "at" )
{ {
Log3 $NAME, 4, Log3 $NAME, 4, "RESIDENTStk $NAME: New wake-up time: $VALUE";
"RESIDENTStk $NAME: New wake-up time: $VALUE";
readingsBeginUpdate( $defs{$NAME} ); readingsBeginUpdate( $defs{$NAME} );
readingsBulkUpdate( $defs{$NAME}, "state", $VALUE ) readingsBulkUpdate( $defs{$NAME}, "state", $VALUE )
@ -307,8 +306,13 @@ if (\$EVTPART0 eq \"stop\") {\
# #
sub RESIDENTStk_wakeupGetBegin($) { sub RESIDENTStk_wakeupGetBegin($) {
my ($NAME) = @_; my ($NAME) = @_;
my $wakeupDefaultTime = AttrVal( $NAME, "wakeupDefaultTime", "07:00" ); my $defaultBeginTime = "05:00";
my $wakeupTime = ReadingsVal( $NAME, "nextRun", $wakeupDefaultTime ); my $wakeupDefaultTime = AttrVal( $NAME, "wakeupDefaultTime", $defaultBeginTime );
my $nextRun = ReadingsVal( $NAME, "nextRun", $wakeupDefaultTime );
my $wakeupTime = (
lc($nextRun) ne "off"
? $nextRun
: ( lc($wakeupDefaultTime) ne "off" ? $wakeupDefaultTime : $defaultBeginTime ) );
my $wakeupOffset = AttrVal( $NAME, "wakeupOffset", 0 ); my $wakeupOffset = AttrVal( $NAME, "wakeupOffset", 0 );
my $return; my $return;
@ -321,9 +325,6 @@ sub RESIDENTStk_wakeupGetBegin($) {
$return = RESIDENTStk_sec2time($seconds); $return = RESIDENTStk_sec2time($seconds);
} }
else {
$return = "07:00";
}
return $return; return $return;
} }
@ -403,10 +404,10 @@ sub RESIDENTStk_wakeupRun($) {
elsif ( $defs{$wakeupMacro}{TYPE} ne "notify" ) { elsif ( $defs{$wakeupMacro}{TYPE} ne "notify" ) {
return "$NAME: device $wakeupMacro is not of type notify"; return "$NAME: device $wakeupMacro is not of type notify";
} }
elsif ($wakeupUserdeviceWakeup) { elsif ($wakeupUserdeviceWakeup) {
Log3 $NAME, 3, Log3 $NAME, 3,
"RESIDENTStk $NAME: Another wake-up program is already being executed, won't trigger $wakeupMacro"; "RESIDENTStk $NAME: Another wake-up program is already being executed, won't trigger $wakeupMacro";
} }
else { else {
Log3 $NAME, 4, Log3 $NAME, 4,
"RESIDENTStk $NAME: trigger $wakeupMacro (running=1)"; "RESIDENTStk $NAME: trigger $wakeupMacro (running=1)";