From c876fdb5de06a615f2a5a6726a0c078d8d9ea9f3 Mon Sep 17 00:00:00 2001 From: dietmar63 Date: Fri, 6 Dec 2013 18:22:31 +0000 Subject: [PATCH] - some improvements to compute state active - some improvements to debug funktionality with verbose in case of disabled attribute git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@4330 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_Heating_Control.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fhem/FHEM/98_Heating_Control.pm b/fhem/FHEM/98_Heating_Control.pm index d250ae558..213bc7a6b 100644 --- a/fhem/FHEM/98_Heating_Control.pm +++ b/fhem/FHEM/98_Heating_Control.pm @@ -320,8 +320,9 @@ sub Heating_Control_Update($) my $active = 1; if (defined $hash->{helper}{CONDITION}) { - $active = eval ($hash->{helper}{CONDITION}); + $active = AnalyzeCommandChain(undef, "{".$hash->{helper}{CONDITION}."}"); } + readingsBeginUpdate($hash); readingsBulkUpdate ($hash, "nextUpdate", strftime("%d.%m.%Y %H:%M:%S",localtime($nextSwitch))); readingsBulkUpdate ($hash, "nextValue", $nextParam); @@ -450,13 +451,17 @@ sub Heating_Control_Device_Schalten($$$$) { Log3 $hash, 4, $mod .strftime('%d.%m.%Y %H:%M:%S',localtime($nowSwitch))." ; aktParam: $aktParam ; newParam: $newParam"; + my $disabled = AttrVal($hash->{NAME}, "disable", 0); + my $disabled_txt = $disabled ? " " : " not"; + Log3 $hash, 4, $mod . "is$disabled_txt disabled"; + #Kommando ausführen my $secondsSinceSwitch = $nowSwitch - $now; if (defined $hash->{helper}{COMMAND} || ($nowSwitch gt "" && $aktParam ne $newParam )) { if (!$setModifier && $secondsSinceSwitch < -60) { Log3 $hash, 5, $mod."no switch in the yesterdays because of the devices type."; } else { - if ($command && AttrVal($hash->{NAME}, "disable", 0) == 0) { + if ($command && !$disabled) { $newParam =~ s/:/ /g; $command =~ s/@/$hash->{DEVICE}/g; $command =~ s/%/$newParam/g;