From cf1c3b08d58b2c8e57f1c482953a514144bbaf86 Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Mon, 4 Aug 2008 15:06:58 +0000 Subject: [PATCH] Autoloading problem: if no device of a given type is specified, its module is not loaded, so the Match entry of the module is not set. -> No way to report unknown devices of a certain type if you not have some device already defined. git-svn-id: https://svn.fhem.de/fhem/trunk@224 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/00_FHZ.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fhem/FHEM/00_FHZ.pm b/fhem/FHEM/00_FHZ.pm index 99a68a57e..57e413317 100755 --- a/fhem/FHEM/00_FHZ.pm +++ b/fhem/FHEM/00_FHZ.pm @@ -520,7 +520,7 @@ FHZ_Read($) my ($hash) = @_; my $buf = $hash->{PortObj}->input(); - my $iohash = $modules{$hash->{TYPE}}; + my $iohash = $modules{$hash->{TYPE}}; # Our (FHZ) module pointer my $name = $hash->{NAME}; ########### @@ -623,7 +623,10 @@ FHZ_Read($) foreach my $m (sort { $modules{$a}{ORDER} cmp $modules{$b}{ORDER} } grep {defined($modules{$_}{ORDER});}keys %modules) { next if($iohash->{Clients} !~ m/:$m:/); - next if($dmsg !~ m/$modules{$m}{Match}/i); + + # Module is not loaded or the message is not for this module + next if(!$modules{$m}{Match} || $dmsg !~ m/$modules{$m}{Match}/i); + no strict "refs"; @found = &{$modules{$m}{ParseFn}}($hash,$dmsg); use strict "refs";