From 67ee35e3f77da0d6b0811a4a7567f9f0416ffc84 Mon Sep 17 00:00:00 2001 From: dietmar63 Date: Thu, 3 Dec 2015 19:24:38 +0000 Subject: [PATCH] 98_WeekdayTimer, 98_Heating_Control: another issue fixed in conjunction with @ % in the context of Attribute delayedExecutionCond git-svn-id: https://svn.fhem.de/fhem/trunk@10077 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_WeekdayTimer.pm | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/fhem/FHEM/98_WeekdayTimer.pm b/fhem/FHEM/98_WeekdayTimer.pm index 5debe142a..b578a455c 100644 --- a/fhem/FHEM/98_WeekdayTimer.pm +++ b/fhem/FHEM/98_WeekdayTimer.pm @@ -753,16 +753,28 @@ sub WeekdayTimer_FensterOffen ($$$) { my ($hash, $event, $time) = @_; my $name = $hash->{NAME}; - my $verzoegerteAusfuehrungCond = AttrVal($hash->{NAME}, "delayedExecutionCond", "0"); - - my %specials= ( - "%HEATING_CONTROL" => $hash->{NAME}, - "%WEEKDAYTIMER" => $hash->{NAME}, - "%NAME" => $hash->{DEVICE}, - "%EVENT" => $event + my %specials = ( + '%HEATING_CONTROL' => $hash->{NAME}, + '%WEEKDAYTIMER' => $hash->{NAME}, + '%NAME' => $hash->{DEVICE}, + '%EVENT' => $event, + '$HEATING_CONTROL' => $hash->{NAME}, + '$WEEKDAYTIMER' => $hash->{NAME}, + '$NAME' => $hash->{DEVICE}, + '$EVENT' => $event, ); - $verzoegerteAusfuehrungCond = EvalSpecials($verzoegerteAusfuehrungCond, %specials); + + my $verzoegerteAusfuehrungCond = AttrVal($hash->{NAME}, "delayedExecutionCond", "0"); + #$verzoegerteAusfuehrungCond = 'xxx(%WEEKDAYTIMER,%NAME,%HEATING_CONTROL,$WEEKDAYTIMER,$EVENT,$NAME,$HEATING_CONTROL)'; + + map { my $key = $_; $key =~ s/\$/\\\$/g; + my $val = $specials{$_}; + $verzoegerteAusfuehrungCond =~ s/$key/$val/g + } keys %specials; + Log3 $hash, 5, "[$name] delayedExecutionCond:$verzoegerteAusfuehrungCond"; + my $verzoegerteAusfuehrung = eval($verzoegerteAusfuehrungCond); + Log3 $hash, 5, "[$name] result of delayedExecutionCond:$verzoegerteAusfuehrung"; if ($verzoegerteAusfuehrung) { if (!defined($hash->{VERZOEGRUNG})) {