2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

RESIDENTStk.pm: revert commit 12011 and make more use of wakeupDefaultTime

git-svn-id: https://svn.fhem.de/fhem/trunk@12012 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
jpawlowski 2016-08-20 12:08:12 +00:00
parent 2d28389009
commit 00ed2ad6b4

View File

@ -868,22 +868,13 @@ sub RESIDENTStk_wakeupGetBegin($;$) {
my $nextRun = ReadingsVal( $NAME, "nextRun", 0 );
my $wakeupDefaultTime = AttrVal( $NAME, "wakeupDefaultTime", 0 );
my $wakeupOffset = AttrVal( $NAME, "wakeupOffset", 0 );
my $wakeupInitTime = ( $wakeupDefaultTime
&& lc($wakeupDefaultTime) ne "off" ? $wakeupDefaultTime : "05:00" );
my $wakeupTime;
if ($wakeupAtdevice) {
# let at-device recalculate after global:INITIALIZED event
# as $nextRun can only be undef at that stage
if ( !$init_done ) {
Log3 $NAME, 4, "RESIDENTStk $NAME: Waiting for FHEM initialization to recalculate Wakeuptime";
InternalTimer( 1, RESIDENTStk_wakeupGetBegin,
( $NAME, $wakeupAtdevice ), 0 );
return "05:00";
}
else {
Log3 $NAME, 4,
Log3 $NAME, 4,
"RESIDENTStk $NAME: Wakeuptime recalculation triggered by at-device $wakeupAtdevice";
}
}
# just give any valuable return to at-device
@ -913,7 +904,7 @@ sub RESIDENTStk_wakeupGetBegin($;$) {
"RESIDENTStk $NAME: Could not automatically clean up at-device, please perform manual cleanup.";
}
return "05:00";
return $wakeupInitTime;
}
# use nextRun value if not OFF
@ -931,7 +922,7 @@ sub RESIDENTStk_wakeupGetBegin($;$) {
# Use a default value to ensure auto-reset at least once a day
else {
$wakeupTime = "05:00";
$wakeupTime = $wakeupInitTime;
Log3 $NAME, 4, "RESIDENTStk $NAME: wakeupGetBegin source: defaultValue";
}