From 3eddd3102a9b35357b047f5131c8133c01884f6a Mon Sep 17 00:00:00 2001 From: martinp876 Date: Tue, 26 Aug 2014 11:38:31 +0000 Subject: [PATCH] remove bug in CCU peerlist git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@6461 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/10_CUL_HM.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fhem/FHEM/10_CUL_HM.pm b/fhem/FHEM/10_CUL_HM.pm index 0635bd0fa..191dc875a 100755 --- a/fhem/FHEM/10_CUL_HM.pm +++ b/fhem/FHEM/10_CUL_HM.pm @@ -6745,19 +6745,19 @@ sub CUL_HM_UpdtCentral($){ $defs{$ioN}{owner_CCU} = $name; } - # --- search for peers to CCU and potentially device this channel + # --- search for peers to CCU and potentially device this channel foreach my $ccuBId (CUL_HM_noDup(grep /$id/ ,map{split ",",AttrVal($_,"peerIDs","")}keys %defs)){ next if (length($ccuBId) !=8); - my $btnS = substr($ccuBId,6,2); - my $btn = hex($btnS) + 0; + # now for each ccu Channel, that ist peered with someone. + my $btn = hex(substr($ccuBId,6,2)) + 0; next if (!$btn); CommandDefine(undef,$name."_Btn$btn CUL_HM $ccuBId") if (!$modules{CUL_HM}{defptr}{$ccuBId}); + my $ccuChnName = $modules{CUL_HM}{defptr}{$ccuBId}{NAME}; foreach my $pn (grep !/^$/, - map{$_ if (AttrVal($_,"peerIDs","") =~ m/$id$btnS/)} + map{$_ if (AttrVal($_,"peerIDs","") =~ m/$ccuBId/)} keys %defs){ - - CUL_HM_ID2PeerList ($name."_Btn$btn",unpack('A8',CUL_HM_name2Id($pn)."01"),1); + CUL_HM_ID2PeerList ($ccuChnName,unpack('A8',CUL_HM_name2Id($pn)."01"),1); } } my $io = AttrVal($name,"IODev","empty");