2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-21 07:56:03 +00:00

98_HMinfo:introduce configChkResult

git-svn-id: https://svn.fhem.de/fhem/trunk@14086 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2017-04-23 13:29:04 +00:00
parent c238969229
commit 60730c8535

View File

@ -1323,6 +1323,7 @@ sub HMinfo_GetFn($@) {#########################################################
} }
elsif($cmd eq "configCheck"){##check peers and register---------------------- elsif($cmd eq "configCheck"){##check peers and register----------------------
if ($hash->{CL}){ if ($hash->{CL}){
$defs{$name}{helper}{cfgChkResult} = "";
my $id = ++$hash->{nb}{cnt}; my $id = ++$hash->{nb}{cnt};
my $bl = BlockingCall("HMinfo_configCheck", join(",",("$name;$id;$hash->{CL}{NAME}",$opt,$filter)), my $bl = BlockingCall("HMinfo_configCheck", join(",",("$name;$id;$hash->{CL}{NAME}",$opt,$filter)),
"HMinfo_bpPost", 30, "HMinfo_bpPost", 30,
@ -1335,6 +1336,9 @@ sub HMinfo_GetFn($@) {#########################################################
$ret =~s/-ret-/\n/g; $ret =~s/-ret-/\n/g;
} }
} }
elsif($cmd eq "configChkResult"){##check peers and register----------------------
return $defs{$name}{helper}{cfgChkResult} ? $defs{$name}{helper}{cfgChkResult} :"no results available";
}
elsif($cmd eq "templateChk"){##template: see if it applies ------------------ elsif($cmd eq "templateChk"){##template: see if it applies ------------------
my $id = ++$hash->{nb}{cnt}; my $id = ++$hash->{nb}{cnt};
my $bl = BlockingCall("HMinfo_templateChk_Get", join(",",("$name;$id;$hash->{CL}{NAME}",$opt,$filter,@a)), my $bl = BlockingCall("HMinfo_templateChk_Get", join(",",("$name;$id;$hash->{CL}{NAME}",$opt,$filter,@a)),
@ -1474,15 +1478,22 @@ sub HMinfo_GetFn($@) {#########################################################
else{ else{
my @cmdLst = my @cmdLst =
( "help" ( "help:noArg"
,"configCheck","param","peerCheck","peerXref" ,"configCheck"
,"protoEvents","msgStat" ,"configChkResult:noArg"
,"param"
,"peerCheck"
,"peerXref"
,"protoEvents"
,"msgStat"
,"rssi rssiG:full,reduced" ,"rssi rssiG:full,reduced"
,"models" ,"models"
# ,"overview" # ,"overview"
,"regCheck","register" ,"regCheck"
,"register"
,"templateList:".join(",",("all",sort keys%HMConfig::culHmTpl)) ,"templateList:".join(",",("all",sort keys%HMConfig::culHmTpl))
,"templateChk","templateUsg" ,"templateChk"
,"templateUsg"
); );
$ret = "Unknown argument $cmd, choose one of ".join (" ",sort @cmdLst); $ret = "Unknown argument $cmd, choose one of ".join (" ",sort @cmdLst);
@ -1518,10 +1529,19 @@ sub HMinfo_SetFn($@) {#########################################################
delete $modules{CUL_HM}{stat}{s}{$_}; delete $modules{CUL_HM}{stat}{s}{$_};
} }
} }
if ($type ne "msgStat"){ if ($type eq "msgErrors"){#clear message events for all devices which has problems
return "unknown parameter - use msgEvents, readings, msgStat, register, rssi, attack or all" my @devL = split(",",InternalVal($hash->{NAME},"W__protoNames",""));
if ($type !~ m/^(msgEvents|readings|register|oldRegs|rssi|all|attack|trigger)$/); push @devL,split(",",InternalVal($hash->{NAME},"CRI__protoNames",""));
$opt .= "d" if ($type =~ m/(msgEvents|rssi)/);# readings apply to all, others device only push @devL,split(",",InternalVal($hash->{NAME},"ERR__protoNames",""));
foreach my $dName (HMinfo_noDup(@devL)){
CUL_HM_Set($defs{$dName},$dName,"clear","msgEvents");
}
}
elsif ($type ne "msgStat"){
return "unknown parameter - use msgEvents, msgErrors, msgStat, readings, register, rssi, attack or all"
if ($type !~ m/^(msgEvents|msgErrors|readings|register|oldRegs|rssi|all|attack|trigger)$/);
$opt .= "d" if ($type =~ m/(msgE|rssi)/);# readings apply to all, others device only
my @entities; my @entities;
foreach my $dName (HMinfo_getEntities($opt,$filter)){ foreach my $dName (HMinfo_getEntities($opt,$filter)){
push @entities,$dName; push @entities,$dName;
@ -1638,7 +1658,7 @@ sub HMinfo_SetFn($@) {#########################################################
my @cmdLst = my @cmdLst =
( "autoReadReg" ( "autoReadReg"
,"clear" #:msgStat,msgEvents,all,rssi,register,trigger,readings" ,"clear" #:msgStat,msgEvents,all,rssi,register,trigger,readings"
,"clearG:msgEvents,readings,register,oldRegs,rssi,msgStat,trigger,attack,all" ,"clearG:msgEvents,msgErrors,msgStat,readings,register,oldRegs,rssi,trigger,attack,all"
,"archConfig:-0,-a","saveConfig","verifyConfig","loadConfig","purgeConfig" ,"archConfig:-0,-a","saveConfig","verifyConfig","loadConfig","purgeConfig"
,"update" ,"update"
,"cpRegs" ,"cpRegs"
@ -1682,6 +1702,7 @@ sub HMInfo_help(){ ############################################################
."\n set clear[G] [-typeFilter-] [msgEvents|readings|msgStat|register|rssi]" ."\n set clear[G] [-typeFilter-] [msgEvents|readings|msgStat|register|rssi]"
."\n # delete readings selective" ."\n # delete readings selective"
."\n msgEvents # delete all protocol-events , msg events" ."\n msgEvents # delete all protocol-events , msg events"
."\n msgErrors # delete protoevents for all devices which had errors"
."\n readings # all readings" ."\n readings # all readings"
."\n register # all register-readings" ."\n register # all register-readings"
."\n oldRegs # outdated register (cleanup) " ."\n oldRegs # outdated register (cleanup) "
@ -2199,6 +2220,7 @@ sub HMinfo_bpPost($) {#bp finished ############################################
} }
} }
delete $defs{$name}{nb}{$id}; delete $defs{$name}{nb}{$id};
$defs{$name}{helper}{cfgChkResult} = $ret;
return; return;
} }
sub HMinfo_bpAbort($) {#bp timeout ############################################ sub HMinfo_bpAbort($) {#bp timeout ############################################
@ -2719,6 +2741,9 @@ sub HMinfo_noDup(@) {#return list with no duplicates###########################
<li><a name="#HMinfoconfigCheck">configCheck</a> <a href="#HMinfoFilter">[filter]</a><br> <li><a name="#HMinfoconfigCheck">configCheck</a> <a href="#HMinfoFilter">[filter]</a><br>
performs a consistency check of HM settings. It includes regCheck and peerCheck performs a consistency check of HM settings. It includes regCheck and peerCheck
</li> </li>
<li><a name="#HMinfoconfigChkResult">configChkResult</a><br>
returns the results of a previous executed configCheck
</li>
<li><a name="#HMinfotemplateList">templateList [&lt;name&gt;]</a><br> <li><a name="#HMinfotemplateList">templateList [&lt;name&gt;]</a><br>
list defined templates. If no name is given all templates will be listed<br> list defined templates. If no name is given all templates will be listed<br>
</li> </li>
@ -2773,6 +2798,7 @@ sub HMinfo_noDup(@) {#return list with no duplicates###########################
executes a set clear ... on all HM entities<br> executes a set clear ... on all HM entities<br>
<ul> <ul>
<li>protocol relates to set clear msgEvents</li> <li>protocol relates to set clear msgEvents</li>
<li>set clear msgEvents for all device with protocol errors</li>
<li>readings relates to set clear readings</li> <li>readings relates to set clear readings</li>
<li>rssi clears all rssi counters </li> <li>rssi clears all rssi counters </li>
<li>msgStat clear HM general message statistics</li> <li>msgStat clear HM general message statistics</li>
@ -3167,6 +3193,9 @@ sub HMinfo_noDup(@) {#return list with no duplicates###########################
<li><a name="#HMinfoconfigCheck">configCheck</a> <a href="#HMinfoFilter">[filter]</a><br> <li><a name="#HMinfoconfigCheck">configCheck</a> <a href="#HMinfoFilter">[filter]</a><br>
Plausibilit&auml;tstest aller HM Einstellungen inklusive regCheck und peerCheck Plausibilit&auml;tstest aller HM Einstellungen inklusive regCheck und peerCheck
</li> </li>
<li><a name="#HMinfoconfigChkResult">configChkResult</a><br>
gibt das Ergebnis eines vorher ausgeführten configCheck zurück
</li>
<li><a name="#HMinfotemplateList">templateList [&lt;name&gt;]</a><br> <li><a name="#HMinfotemplateList">templateList [&lt;name&gt;]</a><br>
zeigt eine Liste von Vorlagen. Ist kein Name angegeben, werden alle Vorlagen angezeigt<br> zeigt eine Liste von Vorlagen. Ist kein Name angegeben, werden alle Vorlagen angezeigt<br>
</li> </li>
@ -3218,10 +3247,11 @@ sub HMinfo_noDup(@) {#return list with no duplicates###########################
<li><a name="#HMinfoautoReadReg">autoReadReg</a> <a href="#HMinfoFilter">[filter]</a><br> <li><a name="#HMinfoautoReadReg">autoReadReg</a> <a href="#HMinfoFilter">[filter]</a><br>
Aktiviert das automatische Lesen der Konfiguration f&uuml;r ein CUL_HM Ger&auml;t, wenn das Attribut autoReadReg auf 1 oder h&ouml;her steht. Aktiviert das automatische Lesen der Konfiguration f&uuml;r ein CUL_HM Ger&auml;t, wenn das Attribut autoReadReg auf 1 oder h&ouml;her steht.
</li> </li>
<li><a name="#HMinfoclear">clear</a> <a href="#HMinfoFilter">[filter]</a> [msgEvents|readings|msgStat|register|rssi]<br> <li><a name="#HMinfoclear">clear</a> <a href="#HMinfoFilter">[filter]</a> [msgEvents|msgErrors|readings|msgStat|register|rssi]<br>
F&uuml;hrt ein set clear ... f&uuml;r alle HM Instanzen aus<br> F&uuml;hrt ein set clear ... f&uuml;r alle HM Instanzen aus<br>
<ul> <ul>
<li>Protocol bezieht sich auf set clear msgEvents</li> <li>Protocol bezieht sich auf set clear msgEvents</li>
<li>Protocol set clear msgEvents fuer alle devices mit protokoll Fehlern</li>
<li>readings bezieht sich auf set clear readings</li> <li>readings bezieht sich auf set clear readings</li>
<li>rssi l&ouml;scht alle rssi Z&auml;hler</li> <li>rssi l&ouml;scht alle rssi Z&auml;hler</li>
<li>msgStat l&ouml;scht die HM Meldungsstatistik</li> <li>msgStat l&ouml;scht die HM Meldungsstatistik</li>