2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

fhem.pl: add eval for diabledForIntervals (Forum #69787)

git-svn-id: https://svn.fhem.de/fhem/trunk@13840 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2017-03-29 07:52:29 +00:00
parent d18b96609e
commit eab055554f
2 changed files with 10 additions and 0 deletions

View File

@ -567,6 +567,10 @@ EOF
<ul>
23:00-24:00 00:00-01:00
</ul>
If parts of the attribute value are enclosed in {}, they are evaluated:
<ul>
{sunset_abs()}-24 {sunrise_abs()}-08
</ul>
</li><br>
<a name="skip_next"></a>
@ -754,6 +758,11 @@ EOF
<ul>
23:00-24:00 00:00-01:00
</ul>
Falls Teile des Wertes in {} eingeschlossen sind, dann werden sie als
ein Perl Ausdruck ausgewertet:
<ul>
{sunset_abs()}-24 {sunrise_abs()}-08
</ul>
</li><br>
<a name="skip_next"></a>

View File

@ -785,6 +785,7 @@ IsDisabled($)
my $dfi = $attr{$devname}{disabledForIntervals};
if(defined($dfi)) {
$dfi =~ s/{([^\x7d]*)}/$cmdFromAnalyze=$1; eval $1/ge; # Forum #69787
my ($sec,$min,$hour,$mday,$month,$year,$wday,$yday,$isdst) = localtime;
my $dhms = sprintf("%s\@%02d:%02d:%02d", $wday, $hour, $min, $sec);
foreach my $ft (split(" ", $dfi)) {