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} )
&& $defs{$wakeupAtdevice}{TYPE} eq "at" )
{
Log3 $NAME, 4,
"RESIDENTStk $NAME: New wake-up time: $VALUE";
Log3 $NAME, 4, "RESIDENTStk $NAME: New wake-up time: $VALUE";
readingsBeginUpdate( $defs{$NAME} );
readingsBulkUpdate( $defs{$NAME}, "state", $VALUE )
@ -307,8 +306,13 @@ if (\$EVTPART0 eq \"stop\") {\
#
sub RESIDENTStk_wakeupGetBegin($) {
my ($NAME) = @_;
my $wakeupDefaultTime = AttrVal( $NAME, "wakeupDefaultTime", "07:00" );
my $wakeupTime = ReadingsVal( $NAME, "nextRun", $wakeupDefaultTime );
my $defaultBeginTime = "05:00";
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 $return;
@ -321,9 +325,6 @@ sub RESIDENTStk_wakeupGetBegin($) {
$return = RESIDENTStk_sec2time($seconds);
}
else {
$return = "07:00";
}
return $return;
}
@ -405,7 +406,7 @@ sub RESIDENTStk_wakeupRun($) {
}
elsif ($wakeupUserdeviceWakeup) {
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 {
Log3 $NAME, 4,