2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-23 20:52:13 +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} = $aVal;
$hash->{Clients} = $clientsJeeLink if( !$hash->{Clients}) ; $hash->{Clients} = $clientsJeeLink if( !$hash->{Clients}) ;
} elsif( $aName eq "MatchList" ) { } elsif( $aName eq "MatchList" ) {
my $match_list = eval $aVal; my $match_list;
if( $@ ) { if( $cmd eq "set" ) {
Log3 $name, 2, $name .": $aVal: ". $@; $match_list = eval $aVal;
if( $@ ) {
Log3 $name, 2, $name .": $aVal: ". $@;
}
} }
if( ref($match_list) eq 'HASH' ) { if( ref($match_list) eq 'HASH' ) {
$hash->{MatchList} = $match_list; $hash->{MatchList} = $match_list;
} else { } else {
$hash->{MatchList} = \%matchListPCA301 if( !$hash->{MatchList} ); $hash->{MatchList} = \%matchListPCA301;
Log3 $name, 2, $name .": $aVal: not a HASH"; 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 } elsif($aName =~ m/^tune/i) { #tune attribute freq / rx:bWidth / rx:rAmpl / rx:sens / tx:deviation / tx:power
# Frequenze: Fc =860+ F x0.0050MHz # Frequenze: Fc =860+ F x0.0050MHz