mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
fhem.pl: add eval for diabledForIntervals (Forum #69787)
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@13840 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
7e25f2444b
commit
c42bf22e2f
@ -567,6 +567,10 @@ EOF
|
|||||||
<ul>
|
<ul>
|
||||||
23:00-24:00 00:00-01:00
|
23:00-24:00 00:00-01:00
|
||||||
</ul>
|
</ul>
|
||||||
|
If parts of the attribute value are enclosed in {}, they are evaluated:
|
||||||
|
<ul>
|
||||||
|
{sunset_abs()}-24 {sunrise_abs()}-08
|
||||||
|
</ul>
|
||||||
</li><br>
|
</li><br>
|
||||||
|
|
||||||
<a name="skip_next"></a>
|
<a name="skip_next"></a>
|
||||||
@ -754,6 +758,11 @@ EOF
|
|||||||
<ul>
|
<ul>
|
||||||
23:00-24:00 00:00-01:00
|
23:00-24:00 00:00-01:00
|
||||||
</ul>
|
</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>
|
</li><br>
|
||||||
|
|
||||||
<a name="skip_next"></a>
|
<a name="skip_next"></a>
|
||||||
|
1
fhem.pl
1
fhem.pl
@ -785,6 +785,7 @@ IsDisabled($)
|
|||||||
|
|
||||||
my $dfi = $attr{$devname}{disabledForIntervals};
|
my $dfi = $attr{$devname}{disabledForIntervals};
|
||||||
if(defined($dfi)) {
|
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 ($sec,$min,$hour,$mday,$month,$year,$wday,$yday,$isdst) = localtime;
|
||||||
my $dhms = sprintf("%s\@%02d:%02d:%02d", $wday, $hour, $min, $sec);
|
my $dhms = sprintf("%s\@%02d:%02d:%02d", $wday, $hour, $min, $sec);
|
||||||
foreach my $ft (split(" ", $dfi)) {
|
foreach my $ft (split(" ", $dfi)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user