From a3ae14782f2dbd226322761077c6856bad1496cf Mon Sep 17 00:00:00 2001 From: borisneubert <> Date: Sat, 24 Jan 2015 19:02:54 +0000 Subject: [PATCH] 67_ECMDDevice.pm: silence some warnings for undefined variables git-svn-id: https://svn.fhem.de/fhem/trunk@7698 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/67_ECMDDevice.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fhem/FHEM/67_ECMDDevice.pm b/fhem/FHEM/67_ECMDDevice.pm index f59557273..3cb9b0cb8 100644 --- a/fhem/FHEM/67_ECMDDevice.pm +++ b/fhem/FHEM/67_ECMDDevice.pm @@ -109,10 +109,11 @@ ECMDDevice_ReplaceSpecials($%) { my ($s, %specials)= @_; + return $s unless(defined($s)); # perform macro substitution foreach my $special (keys %specials) { $s =~ s/$special/$specials{$special}/g; - } + } return $s; } @@ -386,7 +387,7 @@ ECMDDevice_Parse($$) # we run over all readings in that classdef foreach my $r (keys %{$classDef->{readings}}) { my $regex= ECMDDevice_GetCachedReadingsMatch($hash, $classDef, $r); - #Debug " Trying to match reading $r with regular expressing \"$regex\"."; + #Debug " Trying to match reading $r with regular expression \"$regex\" (device $d, classdef $classname, reading $r)."; if($msg =~ m/^$regex$/) { # we found a match Log3 $IOhash, 5, "$name: match regex $regex for reading $r of device $d with class $classname"; @@ -394,7 +395,7 @@ ECMDDevice_Parse($$) push @matches, $d; my $command= ECMDDevice_GetCachedReadingsCommand($hash, $classDef, $r); my $value= ECMDDevice_EvalCommand($hash, $command, $msg); - Log3 $hash, 5, "postprocessed value is $value"; + #Log3 $hash, 5, "postprocessed value is $value"; ECMDDevice_Changed($hash, $r, $value); } }