mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
some bugfixing of nearly invisible things
git-svn-id: https://svn.fhem.de/fhem/trunk@3662 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
89751dd755
commit
464963bf77
@ -18,6 +18,11 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with fhem. If not, see <http://www.gnu.org/licenses/>.
|
# along with fhem. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
# define t1 RandomTimer *23:01:10 Zirkulation 23:02:10 100; attr t1 loglevel 3;
|
||||||
|
# define t2 RandomTimer *23:01:20 Zirkulation 23:03:20 100; attr t2 loglevel 3;
|
||||||
|
# define t3 RandomTimer *23:01:30 Zirkulation 23:04:30 100; attr t3 loglevel 3;
|
||||||
|
# define t4 RandomTimer *23:01:40 Zirkulation 23:02:40 100; attr t4 loglevel 3;
|
||||||
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
package main;
|
package main;
|
||||||
|
|
||||||
@ -129,7 +134,7 @@ sub RandomTimer_ExecRepeater($)
|
|||||||
my ($shour, $smin, $ssec) = split(/:/, $stopTime);
|
my ($shour, $smin, $ssec) = split(/:/, $stopTime);
|
||||||
|
|
||||||
my $timeToStart = $now + 3600*($thour-$hour) + 60*($tmin-$min) + ($tsec-$sec);
|
my $timeToStart = $now + 3600*($thour-$hour) + 60*($tmin-$min) + ($tsec-$sec);
|
||||||
my $timeToStop = $now + 3600*($shour-$hour) + 60*($smin-$min) - ($ssec-$sec);
|
my $timeToStop = $now + 3600*($shour-$hour) + 60*($smin-$min) + ($ssec-$sec);
|
||||||
$timeToStop += 24*3600 if ($timeToStart>=$timeToStop);
|
$timeToStop += 24*3600 if ($timeToStart>=$timeToStop);
|
||||||
|
|
||||||
my $timeToExec;
|
my $timeToExec;
|
||||||
@ -137,7 +142,7 @@ sub RandomTimer_ExecRepeater($)
|
|||||||
if ($now > $timeToStop) {
|
if ($now > $timeToStop) {
|
||||||
|
|
||||||
my $midnight = $now + 24*3600 -(3600*$hour + 60*$min + $sec);
|
my $midnight = $now + 24*3600 -(3600*$hour + 60*$min + $sec);
|
||||||
$timeToExec = max ($timeToStop, $midnight) + 5*60;
|
$timeToExec = max ($timeToStop, $midnight) + 5*60;
|
||||||
$hash->{STATE} = strftime("%H:%M:%S",localtime($timeToStart));
|
$hash->{STATE} = strftime("%H:%M:%S",localtime($timeToStart));
|
||||||
delete $hash->{STARTTIME};
|
delete $hash->{STARTTIME};
|
||||||
|
|
||||||
@ -145,15 +150,13 @@ sub RandomTimer_ExecRepeater($)
|
|||||||
if ($now < $timeToStart) {
|
if ($now < $timeToStart) {
|
||||||
$timeToExec = $timeToStart;
|
$timeToExec = $timeToStart;
|
||||||
} else {
|
} else {
|
||||||
$timeToExec = $now + 5;
|
$timeToExec = $now + 1;
|
||||||
$timeToExec = $now;
|
|
||||||
$function = "RandomTimer_Exec";
|
$function = "RandomTimer_Exec";
|
||||||
|
|
||||||
}
|
}
|
||||||
$hash->{STATE} = strftime("%H:%M:%S",localtime($timeToExec));
|
$hash->{STATE} = strftime("%H:%M:%S",localtime($timeToExec));
|
||||||
}
|
}
|
||||||
|
|
||||||
Log $logLevel, "[".$hash->{NAME}. "]"." Next Timer ".strftime("%d.%m.%Y %H:%M:%S",localtime($timeToExec));
|
Log $logLevel, "[".$hash->{NAME}. "]"." Next timer ".strftime("%d.%m.%Y %H:%M:%S",localtime($timeToExec));
|
||||||
|
|
||||||
delete $hash->{ABSCHALTZEIT};
|
delete $hash->{ABSCHALTZEIT};
|
||||||
RemoveInternalTimer($hash);
|
RemoveInternalTimer($hash);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user