From c7222af1cd9eca5ac80f7ee6910c2ee9035747c8 Mon Sep 17 00:00:00 2001 From: justme1968 Date: Sat, 7 Jun 2014 21:10:24 +0000 Subject: [PATCH] better error checking for MatchList attribute git-svn-id: https://svn.fhem.de/fhem/trunk@6085 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/36_JeeLink.pm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/fhem/FHEM/36_JeeLink.pm b/fhem/FHEM/36_JeeLink.pm index 3ac289091..e891f9cd3 100644 --- a/fhem/FHEM/36_JeeLink.pm +++ b/fhem/FHEM/36_JeeLink.pm @@ -845,16 +845,19 @@ JeeLink_Attr(@) $hash->{Clients} = $aVal; $hash->{Clients} = $clientsJeeLink if( !$hash->{Clients}) ; } elsif( $aName eq "MatchList" ) { - my $match_list = eval $aVal; - if( $@ ) { - Log3 $name, 2, $name .": $aVal: ". $@; + my $match_list; + if( $cmd eq "set" ) { + $match_list = eval $aVal; + if( $@ ) { + Log3 $name, 2, $name .": $aVal: ". $@; + } } if( ref($match_list) eq 'HASH' ) { $hash->{MatchList} = $match_list; } else { - $hash->{MatchList} = \%matchListPCA301 if( !$hash->{MatchList} ); - Log3 $name, 2, $name .": $aVal: not a HASH"; + $hash->{MatchList} = \%matchListPCA301; + Log3 $name, 2, $name .": $aVal: not a HASH" if( $aVal ); } } elsif($aName =~ m/^tune/i) { #tune attribute freq / rx:bWidth / rx:rAmpl / rx:sens / tx:deviation / tx:power # Frequenze: Fc =860+ F x0.0050MHz