mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 03:06:37 +00:00
fhem.pl: add day to disabledForIntervals (Forum #62018)
git-svn-id: https://svn.fhem.de/fhem/trunk@12717 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
64014c9393
commit
cb6f856175
@ -550,10 +550,12 @@ EOF
|
||||
|
||||
<a name="disabledForIntervals"></a>
|
||||
<li>disabledForIntervals HH:MM-HH:MM HH:MM-HH-MM...<br>
|
||||
Space separated list of HH:MM tupels. If the current time is between
|
||||
the two time specifications, the current device is disabled. Instead of
|
||||
HH:MM you can also specify HH or HH:MM:SS. To specify an interval
|
||||
spawning midnight, you have to specify two intervals, e.g.:
|
||||
Space separated list of HH:MM or D@HH:MM tupels. If the current time is
|
||||
between the two time specifications, the current device is disabled.
|
||||
Instead of HH:MM you can also specify HH or HH:MM:SS. D is the day of
|
||||
the week, with 0 indicating Sunday and 3 indicating Wednesday. To
|
||||
specify an interval spawning midnight, you have to specify two
|
||||
intervals, e.g.:
|
||||
<ul>
|
||||
23:00-24:00 00:00-01:00
|
||||
</ul>
|
||||
@ -735,11 +737,12 @@ EOF
|
||||
<a name="disabledForIntervals"></a>
|
||||
<li>disabledForIntervals HH:MM-HH:MM HH:MM-HH-MM...<br>
|
||||
Das Argument ist eine Leerzeichengetrennte Liste von Minuszeichen-
|
||||
getrennten HH:MM Paaren. Falls die aktuelle Uhrzeit zwischen diesen
|
||||
Werten fällt, dann wird die Ausführung, wie beim disable,
|
||||
ausgesetzt. Statt HH:MM kann man auch HH oder HH:MM:SS angeben.
|
||||
Um einen Intervall um Mitternacht zu spezifizieren, muss man zwei
|
||||
einzelne angeben, z.Bsp.:
|
||||
getrennten HH:MM oder D@HH:MM Paaren. Falls die aktuelle Uhrzeit
|
||||
zwischen diesen Werten fällt, dann wird die Ausführung, wie
|
||||
beim disable, ausgesetzt. Statt HH:MM kann man auch HH oder HH:MM:SS
|
||||
angeben. D ist der Tag der Woche, mit 0 als Sonntag and 3 als
|
||||
Mittwoch. Um einen Intervall um Mitternacht zu spezifizieren, muss man
|
||||
zwei einzelne angeben, z.Bsp.:
|
||||
<ul>
|
||||
23:00-24:00 00:00-01:00
|
||||
</ul>
|
||||
|
@ -777,10 +777,14 @@ IsDisabled($)
|
||||
my $dfi = $attr{$devname}{disabledForIntervals};
|
||||
if(defined($dfi)) {
|
||||
my ($sec,$min,$hour,$mday,$month,$year,$wday,$yday,$isdst) = localtime;
|
||||
my $hms = sprintf("%02d:%02d:%02d", $hour, $min, $sec);
|
||||
my $dhms = sprintf("%s\@%02d:%02d:%02d", $wday, $hour, $min, $sec);
|
||||
foreach my $ft (split(" ", $dfi)) {
|
||||
my ($from, $to) = split("-", $ft);
|
||||
return 2 if($from && $to && $from le $hms && $hms le $to);
|
||||
if($from && $to) {
|
||||
$from = "$wday\@$from" if(index($from,"@") < 0);
|
||||
$to = "$wday\@$to" if(index($to, "@") < 0);
|
||||
return 2 if($from le $dhms && $dhms le $to);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user