mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-07 12:58:13 +00:00
HMInfo: info handling
git-svn-id: https://svn.fhem.de/fhem/trunk@10997 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
a824537274
commit
692c8367a5
@ -4652,16 +4652,23 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++
|
||||
CUL_HM_PushCmdStack($hash,'++'.$flag."11$id$dst"."8604$temp");
|
||||
|
||||
my $idTch = ($md =~ m/HM-CC-RT-DN/ ? $dst."05" : $dst."02");
|
||||
my @teamList = ( split(",",InternalVal(CUL_HM_id2Name($dst."05"),"peerList","")) # peers of RT team
|
||||
,split(",",InternalVal(CUL_HM_id2Name($dst."02"),"peerList","")) # peers RT/TC team
|
||||
,$name # myself
|
||||
my @teamList = ( split(",",AttrVal(CUL_HM_id2Name($dst."05"),"peerIDs","")) # peers of RT team
|
||||
,split(",",AttrVal(CUL_HM_id2Name($dst."02"),"peerIDs","")) # peers RT/TC team
|
||||
,$dst."02" # myself
|
||||
);
|
||||
|
||||
foreach my $team (@teamList){
|
||||
next if (!defined $defs{$team} );
|
||||
my $tId = substr(CUL_HM_name2Id($team),0,6);
|
||||
CUL_HM_PushCmdStack($defs{$team},'++'.$flag."11$id$tId"."8604$temp");
|
||||
CUL_HM_UpdtReadSingle($defs{$team},"state",$state,1);
|
||||
foreach my $tId (@teamList){
|
||||
my $teamC = CUL_HM_id2Name($tId);
|
||||
$tId = substr($tId,0,6);
|
||||
my $teamD = CUL_HM_id2Name($tId);
|
||||
next if (!defined $defs{$teamC} );
|
||||
CUL_HM_PushCmdStack($defs{$teamD},'++'.$flag."11$id$tId"."8604$temp");
|
||||
CUL_HM_UpdtReadSingle($defs{$teamC},"state",$state,1);
|
||||
if ( $tId ne $dst
|
||||
&& CUL_HM_getRxType($defs{$teamD}) & "02"){
|
||||
# burst device - we need to send immediately
|
||||
CUL_HM_SndCmd($defs{$teamD},"++B112$id".substr($tId,0,6));
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
|
@ -240,7 +240,7 @@ sub HMinfo_status($){##########################################################
|
||||
$nbrD++;
|
||||
push @IOdev,$ehash->{IODev}{NAME} if($ehash->{IODev} && $ehash->{IODev}{NAME});
|
||||
$IOccu{(split ":",AttrVal($eName,"IOgrp","no"))[0]}=1;
|
||||
push @Anames,$eName if ($attr{$eName}{actStatus} && $attr{$eName}{actStatus} ne "alive");
|
||||
push @Anames,$eName if ($attr{$eName}{actStatus} && $attr{$eName}{actStatus} eq "dead");
|
||||
|
||||
foreach (grep /ErrIoId_/, keys %{$ehash}){# detect addtional critical entries
|
||||
my $k = $_;
|
||||
@ -265,11 +265,23 @@ sub HMinfo_status($){##########################################################
|
||||
$d .= "$_:$sum{$read}{$_},"foreach(keys %{$sum{$read}});
|
||||
push @updates,"I_sum_$read:".$d;
|
||||
}
|
||||
foreach my $read(grep {defined $err{$_}} keys %errFlt){#--- disp err count
|
||||
my $d;
|
||||
$d .= "$_:$err{$read}{$_},"foreach(keys %{$err{$read}});
|
||||
push @updates,"ERR_$read:".$d;
|
||||
}
|
||||
foreach my $read(keys %errFlt) {
|
||||
if (defined $err{$read}) {
|
||||
my $d;
|
||||
$d .= "$_:$err{$read}{$_},"foreach(keys %{$err{$read}});
|
||||
push @updates,"ERR_$read:".$d;
|
||||
}
|
||||
elsif (defined $hash->{READINGS}{"ERR_$read"}) {
|
||||
if ($hash->{READINGS}{"ERR_$read"}{VAL} ne '-') {
|
||||
# Error condition has been resolved, push empty update
|
||||
push @updates,"ERR_$read:";
|
||||
}
|
||||
else {
|
||||
# Delete reading again if it was already empty
|
||||
delete $hash->{READINGS}{"ERR_$read"};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@errNames = grep !/^$/,HMinfo_noDup(@errNames);
|
||||
$hash->{ERR_names} = join",",@errNames if(@errNames);# and name entities
|
||||
@ -294,9 +306,9 @@ sub HMinfo_status($){##########################################################
|
||||
# Current Events are Rcv,NACK,IOerr,Resend,ResendFail,Snd
|
||||
# additional variables are protCmdDel,protCmdPend,protState,protLastRcv
|
||||
|
||||
push @updates,"CRIT__protocol:" .join(",",map {"$_:$protC{$_}"} grep {$protC{$_}} keys(%protC));
|
||||
push @updates,"ERR__protocol:" .join(",",map {"$_:$protE{$_}"} grep {$protE{$_}} keys(%protE));
|
||||
push @updates,"W__protocol:" .join(",",map {"$_:$protW{$_}"} grep {$protW{$_}} keys(%protW));
|
||||
push @updates,"CRIT__protocol:" .join(",",map {"$_:$protC{$_}"} grep {$protC{$_}} sort keys(%protC));
|
||||
push @updates,"ERR__protocol:" .join(",",map {"$_:$protE{$_}"} grep {$protE{$_}} sort keys(%protE));
|
||||
push @updates,"W__protocol:" .join(",",map {"$_:$protW{$_}"} grep {$protW{$_}} sort keys(%protW));
|
||||
|
||||
my @tpu = devspec2array("TYPE=CUL_HM:FILTER=state=unreachable");
|
||||
push @updates,"ERR__unreachable:".scalar(@tpu);
|
||||
@ -327,6 +339,7 @@ sub HMinfo_status($){##########################################################
|
||||
|
||||
foreach (grep(/^(ERR|W_|I_|C_|CRI_)/,keys%{$hash})){# remove empty entries
|
||||
delete $hash->{$_} if(!$hash->{$_});
|
||||
# delete $hash->{READINGS}{$_};
|
||||
}
|
||||
|
||||
readingsBeginUpdate($hash);
|
||||
|
Loading…
x
Reference in New Issue
Block a user