From 35bd7010f2519c4aac2a970eab0e852faff1fb75 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Fri, 20 Nov 2009 11:10:07 +0000 Subject: [PATCH] Multi-IODev XXX_MSGCNT bug fixed git-svn-id: https://svn.fhem.de/fhem/trunk@481 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/99_SUNRISE_EL.pm | 3 --- fhem/fhem.pl | 16 ++++++++++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/fhem/FHEM/99_SUNRISE_EL.pm b/fhem/FHEM/99_SUNRISE_EL.pm index b020d5e9e..57f479cbe 100755 --- a/fhem/FHEM/99_SUNRISE_EL.pm +++ b/fhem/FHEM/99_SUNRISE_EL.pm @@ -1,7 +1,4 @@ ############################################## -# - Please call sunrise_coord before using this module, else you'll get times -# for frankfurt am main (germany). See the "at" entry in commandref.html -# # This code is derived from DateTime::Event::Sunrise, version 0.0501. # Simplified and removed further package # dependency (DateTime, # Params::Validate, etc). For comments see the original code. diff --git a/fhem/fhem.pl b/fhem/fhem.pl index d030f7d24..6c81c305f 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -155,7 +155,7 @@ my $nextat; # Time when next timer will be triggered. my $intAtCnt=0; my %duplicate; # Pool of received msg for multi-fhz/cul setups my $duplidx=0; # helper for the above pool -my $cvsid = '$Id: fhem.pl,v 1.83 2009-11-14 09:20:37 rudolfkoenig Exp $'; +my $cvsid = '$Id: fhem.pl,v 1.84 2009-11-20 11:10:07 rudolfkoenig Exp $'; my $namedef = "where is either:\n" . "- a single device name\n" . @@ -2046,7 +2046,18 @@ Dispatch($$$) Log 5, "$name dispatch $dmsg"; my ($isdup, $idx) = CheckDuplicate($name, $dmsg); - return $duplicate{$idx}{FND} if($isdup); + if($isdup) { + my $found = $duplicate{$idx}{FND}; + foreach my $found (@{$found}) { + if($addvals) { + foreach my $av (keys %{$addvals}) { + $defs{$found}{"${name}_$av"} = $addvals->{$av}; + } + } + $defs{$found}{"${name}_MSGCNT"}++; + } + return $duplicate{$idx}{FND}; + } my @found; my $last_module; @@ -2094,6 +2105,7 @@ Dispatch($$$) return undef; } else { if($defs{$found}) { + $defs{$found}{MSGCNT}++; if($addvals) { foreach my $av (keys %{$addvals}) { $defs{$found}{"${name}_$av"} = $addvals->{$av};