better error checking for MatchList attribute

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@6085 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme1968
2014-06-07 21:10:24 +00:00
parent f91d634328
commit f8d1e00cc9

View File

@@ -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