remove duplicate at SD

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@3920 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2013-09-17 14:09:47 +00:00
parent cba99180a7
commit d728c9742c

View File

@ -219,6 +219,7 @@ sub CUL_HM_updateConfig($){
my $md = CUL_HM_Get($hash,$name,"param","model"); my $md = CUL_HM_Get($hash,$name,"param","model");
if ("HM-CC-TC" eq $md){ if ("HM-CC-TC" eq $md){
$hash->{helper}{role}{chn} = 1 if (length($id) == 6); #tc special $hash->{helper}{role}{chn} = 1 if (length($id) == 6); #tc special
$attr{$name}{stateFormat} = "last:trigLast" if ($chn eq "03");
} }
elsif ("dimmer" eq $st) {#setup virtual dimmer channels elsif ("dimmer" eq $st) {#setup virtual dimmer channels
my $mId = CUL_HM_getMId($hash); my $mId = CUL_HM_getMId($hash);
@ -1260,18 +1261,20 @@ sub CUL_HM_Parse($$) {##############################
); );
} }
# - - - - - - now handle the team - - - - - - # - - - - - - now handle the team - - - - - -
$shash->{helper}{alarmList} = "" if (!$shash->{helper}{alarmList}); my @alarmArry;
if ($state eq "01") { # clear Alarm for one sensor @alarmArry = split(",",$shash->{helper}{alarmList})
$shash->{helper}{alarmList} =~ s/",".$dst//; if ($shash->{helper}{alarmList});
if ($state eq "01") { # clear alarm for sensor
@alarmArry = grep !/$dst/,@alarmArry;
} }
else{ # add alarm for Sensor else{ # add alarm for Sensor
$shash->{helper}{alarmList} .= ",".$dst; @alarmArry = CUL_HM_noDup(@alarmArry,$dst);
} }
my $alarmList; # make alarm ID list readable my $alarmList; # make alarm ID list readable
foreach(split(",",$shash->{helper}{alarmList})){ foreach(@alarmArry){
$alarmList .= CUL_HM_id2Name($_)."," if ($_); $alarmList .= CUL_HM_id2Name($_)."," if ($_);
} }
$shash->{helper}{alarmList} = "" if (!$alarmList); $shash->{helper}{alarmList} = join",",@alarmArry;
push @event,"state:" .($alarmList?"smoke-Alarm":"off" ); push @event,"state:" .($alarmList?"smoke-Alarm":"off" );
push @event,"smoke_detect:" .($alarmList?$alarmList :"none"); push @event,"smoke_detect:" .($alarmList?$alarmList :"none");
#--- check out teamstatus, members might be shy --- #--- check out teamstatus, members might be shy ---