From b6825222b34a4564b5ebdbd8d7912385d624414b Mon Sep 17 00:00:00 2001 From: martinp876 Date: Fri, 16 May 2014 11:04:22 +0000 Subject: [PATCH] pmsw correction for threashold register, tempList handling of HMInfo improvement git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@5874 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_HMinfo.pm | 32 ++++++++++++++++++++++---------- fhem/FHEM/HMConfig.pm | 16 ++++++++-------- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/fhem/FHEM/98_HMinfo.pm b/fhem/FHEM/98_HMinfo.pm index a964b6c63..30e127599 100644 --- a/fhem/FHEM/98_HMinfo.pm +++ b/fhem/FHEM/98_HMinfo.pm @@ -626,7 +626,6 @@ sub HMinfo_tempList(@) { ###################################################### sub HMinfo_tempListTmpl(@) { ################################################## my ($filter,$tmpl,$action,$fName)=@_; $filter = "." if (!$filter); -# return "no template name given" if (!$tmpl); my %dl =("Sat"=>0,"Sun"=>1,"Mon"=>2,"Tue"=>3,"Wed"=>4,"Thu"=>5,"Fri"=>6); my $ret = ""; my @el ; @@ -640,19 +639,20 @@ sub HMinfo_tempListTmpl(@) { ################################################## push @el,$chN; } return "no entities selected" if (!scalar @el); - $tmpl = (!$tmpl)?"":($fName?$fName.":".$tmpl:$tmpl); + $tmpl = (!$tmpl) ? "" + : ($fName ? $fName.":".$tmpl + : $tmpl); my @rs; foreach my $name (@el){ my $tmplDev; - if (!$tmpl){ - $tmplDev = AttrVal($name,"tempListTmpl","tempList.cfg:$name"); - } - else{ - $tmplDev = $tmpl; - } + $tmplDev = $tmpl ? $tmpl + : AttrVal($name,"tempListTmpl","tempList.cfg:$name"); + my $r = CUL_HM_tempListTmpl($name,$action,$tmplDev); - - push @rs, "$tmplDev -> ".($r?$r:"passed:$name")."\n"; + + push @rs, ($r ? "fail : $tmplDev for $name: $r" + : "passed: $tmplDev for $name") + ."\n"; } $ret .= join "",sort @rs; return $ret; @@ -890,6 +890,15 @@ sub HMinfo_GetFn($@) {######################################################### .HMinfo_peerCheck(@entities) .HMinfo_burstCheck(@entities) .HMinfo_paramCheck(@entities); + + my @td = (devspec2array("model=HM-CC-RT-DN.*:FILTER=chanNo=04:FILTER=tempListTmpl=.*"), + devspec2array("model=HM.*-TC.*:FILTER=chanNo=02:FILTER=tempListTmpl=.*")); + my @tlr; + foreach my $e (@td){ + my $tr = CUL_HM_tempListTmpl($e,"verify",AttrVal($e,"tempListTmpl","tempList.cfg:$e")); + push @tlr,$tr if($tr); + } + $ret .= "\templist mismatch \n ".join("\n ",@tlr) if (@tlr); } elsif($cmd eq "templateChk"){##template: see if it applies ------------------ my $repl; @@ -1187,6 +1196,9 @@ sub HMinfo_SetFn($@) {######################################################### $ret = HMinfo_tempList($filter,$a[0],$fn); } elsif($cmd eq "tempListTmpl"){##handle thermostat templist from file -------- + if ($a[0] =~ m/(verify|restore)/){#allow default template - i.e. not specified + unshift @a,""; + } my $fn = $a[2]?$a[2]:""; my $ac = $a[1]?$a[1]:"verify"; $fn = AttrVal($name,"configDir",".")."\/".$fn if ($fn && $fn !~ m/\//); diff --git a/fhem/FHEM/HMConfig.pm b/fhem/FHEM/HMConfig.pm index 7f14a5c97..9f5bd5ea6 100644 --- a/fhem/FHEM/HMConfig.pm +++ b/fhem/FHEM/HMConfig.pm @@ -547,14 +547,14 @@ my $K_actDetID = '000000'; # id of actionDetector cndTxDecAbove =>{a=>133 ,s=>1 ,l=>1,min=>0 ,max=>255 ,c=>'' ,f=>'' ,u=>'' ,d=>1,t=>"level for cndTxCycAbove"}, cndTxDecBelow =>{a=>134 ,s=>1 ,l=>1,min=>0 ,max=>255 ,c=>'' ,f=>'' ,u=>'' ,d=>1,t=>"level for cndTxCycBelow"}, - txThrLoPwr =>{a=>135.0,s=>4 ,l=>1,min=>0 ,max=>3680 ,c=>'' ,f=>'100' ,u=>'W' ,d=>1,t=>"threshold low power"}, - txThrHiPwr =>{a=>139.0,s=>4 ,l=>1,min=>0 ,max=>3680 ,c=>'' ,f=>'100' ,u=>'W' ,d=>1,t=>"threshold high power"}, - txThrLoCur =>{a=>135.0,s=>4 ,l=>1,min=>0 ,max=>16000 ,c=>'' ,f=>'100' ,u=>'mA' ,d=>1,t=>"threshold low current"}, - txThrHiCur =>{a=>139.0,s=>4 ,l=>1,min=>0 ,max=>16000 ,c=>'' ,f=>'100' ,u=>'mA' ,d=>1,t=>"threshold high current"}, - txThrLoVlt =>{a=>135.0,s=>4 ,l=>1,min=>115 ,max=>255 ,c=>'' ,f=>'100' ,u=>'V' ,d=>1,t=>"threshold low voltage"}, - txThrHiVlt =>{a=>139.0,s=>4 ,l=>1,min=>115 ,max=>255 ,c=>'' ,f=>'100' ,u=>'V' ,d=>1,t=>"threshold high voltage"}, - txThrLoFrq =>{a=>135.0,s=>4 ,l=>1,min=>48.72,max=>51.27 ,c=>'' ,f=>'100' ,u=>'Hz' ,d=>1,t=>"threshold low frequency"}, - txThrHiFrq =>{a=>139.0,s=>4 ,l=>1,min=>48.72,max=>51.27 ,c=>'' ,f=>'100' ,u=>'Hz' ,d=>1,t=>"threshold high frequency"}, + txThrHiPwr =>{a=>135.0,s=>4 ,l=>1,min=>0 ,max=>3680 ,c=>'' ,f=>'100' ,u=>'W' ,d=>1,t=>"threshold low power"}, + txThrLoPwr =>{a=>139.0,s=>4 ,l=>1,min=>0 ,max=>3680 ,c=>'' ,f=>'100' ,u=>'W' ,d=>1,t=>"threshold high power"}, + txThrHiCur =>{a=>135.0,s=>4 ,l=>1,min=>0 ,max=>16000 ,c=>'' ,f=>'' ,u=>'mA' ,d=>1,t=>"threshold low current"}, + txThrLoCur =>{a=>139.0,s=>4 ,l=>1,min=>0 ,max=>16000 ,c=>'' ,f=>'' ,u=>'mA' ,d=>1,t=>"threshold high current"}, + txThrHiVlt =>{a=>135.0,s=>4 ,l=>1,min=>115 ,max=>255 ,c=>'' ,f=>'10' ,u=>'V' ,d=>1,t=>"threshold low voltage"}, + txThrLoVlt =>{a=>139.0,s=>4 ,l=>1,min=>115 ,max=>255 ,c=>'' ,f=>'10' ,u=>'V' ,d=>1,t=>"threshold high voltage"}, + txThrHiFrq =>{a=>135.0,s=>4 ,l=>1,min=>48.72,max=>51.27 ,c=>'' ,f=>'100' ,u=>'Hz' ,d=>1,t=>"threshold low frequency"}, + txThrLoFrq =>{a=>139.0,s=>4 ,l=>1,min=>48.72,max=>51.27 ,c=>'' ,f=>'100' ,u=>'Hz' ,d=>1,t=>"threshold high frequency"}, evtFltrPeriod =>{a=> 1.0,s=>0.4,l=>1,min=>0.5,max=>7.5 ,c=>'' ,f=>2 ,u=>'s' ,d=>1,t=>"event filter period"}, evtFltrNum =>{a=> 1.4,s=>0.4,l=>1,min=>1 ,max=>15 ,c=>'' ,f=>'' ,u=>'' ,d=>1,t=>"sensitivity - read each n-th puls"},