2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

better error checking for MatchList attribute

git-svn-id: https://svn.fhem.de/fhem/trunk@6085 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2014-06-07 21:10:24 +00:00
parent 8595b705b3
commit f0d9673038

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