mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-04 11:26:55 +00:00
CUL_HM:bugfix, regTable introduction
git-svn-id: https://svn.fhem.de/fhem/trunk@9830 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
3448afa4d3
commit
23a0102b5c
@ -1905,8 +1905,11 @@ sub CUL_HM_Parse($$) {#########################################################
|
||||
$physLvl = ReadingsVal($mh{cName},"phyLevel",$val)
|
||||
if(!defined $physLvl); #not updated? use old or ignore
|
||||
|
||||
my $vs = ($mh{cHash}->{helper}{lm} && $mh{cHash}->{helper}{lm}{$val})?$mh{cHash}->{helper}{lm}{$val}
|
||||
:($val==100 ? "on":($pVal==0 ? "off":"$val")); # user string...
|
||||
my $vs = ($mh{cHash}->{helper}{lm} && $mh{cHash}->{helper}{lm}{$val})
|
||||
?$mh{cHash}->{helper}{lm}{$val}
|
||||
:($val==100 ? "on"
|
||||
:($pVal==0 ? "off"
|
||||
: "$val")); # user string...
|
||||
push @evtEt,[$mh{cHash},1,"level:$val"];
|
||||
push @evtEt,[$mh{cHash},1,"pct:$val"]; # duplicate to level - necessary for "slider"
|
||||
push @evtEt,[$mh{cHash},1,"deviceMsg:$vs$target"] if($mh{chnM} ne "00");
|
||||
@ -3257,6 +3260,8 @@ sub CUL_HM_Get($@) {#+++++++++++++++++ get command+++++++++++++++++++++++++++++
|
||||
$h = $culHmVrtGets->{$cmd} if(!defined($h) && $roleV);
|
||||
$h = $culHmSubTypeGets->{$st}{$cmd} if(!defined($h) && $culHmSubTypeGets->{$st});
|
||||
$h = $culHmModelGets->{$md}{$cmd} if(!defined($h) && $culHmModelGets->{$md});
|
||||
$h = "" if(!defined($h) && (eval "defined(&HMinfo_GetFn)" && $cmd eq "regTable"));
|
||||
|
||||
my @h;
|
||||
@h = split(" ", $h) if($h);
|
||||
|
||||
@ -3266,7 +3271,9 @@ sub CUL_HM_Get($@) {#+++++++++++++++++ get command+++++++++++++++++++++++++++++
|
||||
if($roleV) {foreach(keys %{$culHmVrtGets} ){push @arr,"$_:".$culHmVrtGets->{$_} }};
|
||||
if($culHmSubTypeGets->{$st}) {foreach(keys %{$culHmSubTypeGets->{$st}}){push @arr,"$_:".${$culHmSubTypeGets->{$st}}{$_} }};
|
||||
if($culHmModelGets->{$md}) {foreach(keys %{$culHmModelGets->{$md}} ){push @arr,"$_:".${$culHmModelGets->{$md}}{$_} }};
|
||||
|
||||
if($culHmModelGets->{$md}) {foreach(keys %{$culHmModelGets->{$md}} ){push @arr,"$_:".${$culHmModelGets->{$md}}{$_} }};
|
||||
if(eval"defined(&HMinfo_GetFn)"){ {push @arr,"regTable:" }};
|
||||
|
||||
foreach(@arr){
|
||||
my ($cmd,$val) = split(":",$_,2);
|
||||
if (!$val ||
|
||||
@ -3359,11 +3366,14 @@ sub CUL_HM_Get($@) {#+++++++++++++++++ get command+++++++++++++++++++++++++++++
|
||||
}
|
||||
else{
|
||||
my $regVal = CUL_HM_getRegFromStore($name,$regReq,$list,$peerId);
|
||||
$regVal =~ s/ .*// if ($cmd eq "regVal");
|
||||
$regVal =~ s/ .*// if ($cmd eq "regVal");
|
||||
return ($regVal =~ m /^invalid/)? "Value not captured:$name - $regReq"
|
||||
: $regVal;
|
||||
}
|
||||
}
|
||||
elsif($cmd eq "regTable") { ########################################
|
||||
return HMinfo_GetFn($hash,$name,"register","-f","\^".$name."\$");
|
||||
}
|
||||
elsif($cmd eq "regList") { #################################################
|
||||
my @regArr = CUL_HM_getRegN($st,$md,$chn);
|
||||
|
||||
@ -8088,15 +8098,10 @@ sub CUL_HM_getAttrInt($@){#return attrValue as integer
|
||||
my ($name,$attrName,$default) = @_;
|
||||
$default = 0 if (!defined $default);
|
||||
if($name && $defs{$name}){
|
||||
no warnings 'numeric';
|
||||
my $val = (defined $attr{$name}{$attrName})
|
||||
?int($attr{$name}{$attrName})
|
||||
:"";
|
||||
my $devN = $defs{$name}{device}?$defs{$name}{device}:$name;
|
||||
$val = int($attr{$devN}{$attrName}?$attr{$devN}{$attrName}:$default)+0
|
||||
if($val eq "");
|
||||
use warnings 'numeric';
|
||||
return substr($val,0,2);
|
||||
my $val = "0".AttrVal($name,$attrName,AttrVal($devN,$attrName,$default));
|
||||
$val =~s/(\d*).*/$1/;
|
||||
return int($val);
|
||||
}
|
||||
else{
|
||||
return $default;
|
||||
|
@ -781,11 +781,12 @@ sub HMinfo_tempListTmplView() { ###############################################
|
||||
sub HMinfo_tempListDefFn(@) { ###########################################
|
||||
#return Default filename for tempList
|
||||
my ($fn) = shift;
|
||||
$fn = "" if (!defined $fn);
|
||||
my $ret = "";
|
||||
my ($n) =devspec2array("TYPE=HMinfo");
|
||||
$ret .= "$attr{global}{modpath}/" if (!$fn || $fn !~ m/^\//);#if not absolut path add modpath
|
||||
$ret .= AttrVal($n,"configDir",".")."/" if (!$fn || $fn !~ m/..*\//);#if no \ them add defDir
|
||||
$ret .= AttrVal($n,"configTempFile","tempList.cfg")if (!$fn);#set filename
|
||||
$ret .= "$attr{global}{modpath}/" if (!$fn || $fn !~ m/^\//); #no path? add modpath
|
||||
$ret .= AttrVal($n,"configDir",".")."/" if (!$fn || $fn !~ m/..*\//);#no dir? add defDir
|
||||
$ret .= AttrVal($n,"configTempFile","tempList.cfg")if (!$fn); #set filename
|
||||
|
||||
return $ret.$fn;
|
||||
}
|
||||
@ -1170,8 +1171,7 @@ sub HMinfo_GetFn($@) {#########################################################
|
||||
$repl .= HMinfo_templateChk($dName,$t,$p,split(" ",$defs{$dName}{helper}{tmpl}{$_}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return $repl;
|
||||
}
|
||||
elsif($cmd eq "templateUsg"){##template: see if it applies ------------------
|
||||
@ -1919,7 +1919,6 @@ sub HMinfo_archConfigPost($) {################################################
|
||||
shift @arr;
|
||||
push @{$modules{CUL_HM}{helper}{confUpdt}},@arr;
|
||||
delete $defs{$name}{nb}{$id};
|
||||
|
||||
return ;
|
||||
}
|
||||
|
||||
@ -2146,7 +2145,7 @@ sub HMinfo_templateChk(@){#####################################################
|
||||
}
|
||||
}
|
||||
}
|
||||
$repl .= "$aName $pSet-> failed\n$repl" if($repl);
|
||||
$repl = "$aName $pSet-> failed\n$repl" if($repl);
|
||||
|
||||
return $repl;
|
||||
}
|
||||
|
@ -682,7 +682,8 @@ foreach my $al (keys %culHmModel){ # duplicate entries for alias devices
|
||||
#CC-TC
|
||||
|
||||
#--- list 3, link level for actor - mainly in short/long hash, only specials here------------------
|
||||
lgMultiExec =>{a=>138.5,s=>0.1,l=>3,min=>0 ,max=>1 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>"multiple execution per repeat of long trigger" ,lit=>{off=>0,on=>1}},
|
||||
lgMultiExec =>{a=>138.5,s=>0.1,l=>3,min=>0 ,max=>1 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>"execution per repeat message" ,lit=>{off=>0,on=>1}},
|
||||
shMultiExec =>{a=> 10.5,s=>0.1,l=>3,min=>0 ,max=>1 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>"reg unused, placeholder only" ,lit=>{off=>0,on=>1}},
|
||||
|
||||
#--- list 4, link level for Button ------------------
|
||||
peerNeedsBurst =>{a=> 1.0,s=>0.1,l=>4,min=>0 ,max=>1 ,c=>'lit' ,f=>'' ,u=>'' ,d=>1,t=>"peer expects burst" ,lit=>{off=>0,on=>1}},
|
||||
@ -794,7 +795,7 @@ foreach my $al (keys %culHmModel){ # duplicate entries for alias devices
|
||||
,CtValLo =>1,CtValHi =>1
|
||||
,CtOn =>1,CtDlyOn =>1,CtRampOn =>1,CtRefOn =>1
|
||||
,CtOff =>1,CtDlyOff =>1,CtRampOff =>1,CtRefOff =>1
|
||||
,lgMultiExec =>1
|
||||
,lgMultiExec =>1,shMultiExec =>1
|
||||
}
|
||||
,dimmer =>{ intKeyVisib =>1
|
||||
,transmitTryMax =>1,statusInfoMinDly=>1,statusInfoRandom=>1,powerUpAction =>1
|
||||
@ -810,7 +811,7 @@ foreach my $al (keys %culHmModel){ # duplicate entries for alias devices
|
||||
,CtOn =>1,CtDlyOn =>1,CtRampOn =>1
|
||||
,CtOff =>1,CtDlyOff =>1,CtRampOff =>1
|
||||
,OffDlyStep =>1,OffDlyNewTime =>1,OffDlyOldTime =>1
|
||||
,lgMultiExec =>1
|
||||
,lgMultiExec =>1,shMultiExec =>1
|
||||
}
|
||||
,switch =>{ intKeyVisib =>1,sign =>1
|
||||
,OnTime =>1,OffTime =>1,OnDly =>1,OffDly =>1
|
||||
@ -818,7 +819,7 @@ foreach my $al (keys %culHmModel){ # duplicate entries for alias devices
|
||||
,CtValLo =>1,CtValHi =>1
|
||||
,CtOn =>1,CtDlyOn =>1,CtOff =>1,CtDlyOff =>1
|
||||
,ActionType =>1,OnTimeMode =>1,OffTimeMode =>1
|
||||
,lgMultiExec =>1
|
||||
,lgMultiExec =>1,shMultiExec =>1
|
||||
}
|
||||
,winMatic =>{ intKeyVisib =>1,signal =>1,signalTone =>1,keypressSignal =>1}
|
||||
,keyMatic =>{ signal =>1,signalTone =>1,keypressSignal =>1
|
||||
@ -912,7 +913,7 @@ $culHmRegType{pushButton} = $culHmRegType{remote};
|
||||
,SwJtOn =>1,SwJtOff =>1,SwJtDlyOn =>1,SwJtDlyOff =>1
|
||||
,CtValLo =>1,CtValHi =>1
|
||||
,CtOn =>1,CtDlyOn =>1,CtOff =>1,CtDlyOff =>1
|
||||
,ActionType =>1,ActNum =>1,lgMultiExec =>1
|
||||
,ActionType =>1,ActNum =>1,lgMultiExec =>1,shMultiExec =>1
|
||||
}
|
||||
,"HM-OU-CF-PL" =>{ ActTypeOuCf =>1,ActNum =>1}
|
||||
,"HM-OU-CM-PCB" =>{ localResetDis =>1,
|
||||
@ -922,7 +923,7 @@ $culHmRegType{pushButton} = $culHmRegType{remote};
|
||||
,CtValLo =>1,CtValHi =>1
|
||||
,CtOn =>1,CtDlyOn =>1,CtOff =>1,CtDlyOff =>1
|
||||
,ActionType =>1
|
||||
,ActTypeMp3 =>1,ActNum =>1,Intense =>1,lgMultiExec =>1
|
||||
,ActTypeMp3 =>1,ActNum =>1,Intense =>1,lgMultiExec =>1,shMultiExec =>1
|
||||
}
|
||||
,"HM-SEC-MDIR" =>{ sabotageMsg =>1}
|
||||
,"HM-CC-SCD" =>{ peerNeedsBurst =>1,expectAES =>1
|
||||
@ -969,7 +970,7 @@ $culHmRegType{pushButton} = $culHmRegType{remote};
|
||||
,ActionType =>1,OffTimeMode =>1,OnTimeMode =>1
|
||||
,DimJtOn =>1,DimJtOff =>1,DimJtDlyOn =>1,DimJtDlyOff =>1
|
||||
,DimJtRampOn =>1,DimJtRampOff =>1
|
||||
,lgMultiExec =>1
|
||||
,lgMultiExec =>1,shMultiExec =>1
|
||||
}
|
||||
,"HM-Sen-Wa-Od" =>{ cyclicInfoMsgDis=>1, transmDevTryMax =>1,localResDis =>1
|
||||
, ledOnTime =>1,transmitTryMax =>1
|
||||
@ -1133,7 +1134,7 @@ $culHmRegModel{"ROTO_ZEL-STG-RM-DWT-10"}= $culHmRegModel{"HM-PB-4DIS-WM"};
|
||||
,CtValLo =>1,CtValHi =>1
|
||||
,CtOn =>1,CtDlyOn =>1,CtOff =>1,CtDlyOff =>1
|
||||
,ActionType =>1,OnTimeMode =>1,OffTimeMode =>1
|
||||
,lgMultiExec =>1,powerUpAction =>1
|
||||
,lgMultiExec =>1,shMultiExec =>1,powerUpAction =>1
|
||||
}
|
||||
,"HM-ES-PMSw1-Pl02" =>{ averaging =>1
|
||||
,txMinDly =>1,txThrPwr =>1,txThrCur =>1,txThrVlt =>1,txThrFrq =>1
|
||||
@ -1175,7 +1176,7 @@ $culHmRegModel{"ROTO_ZEL-STG-RM-DWT-10"}= $culHmRegModel{"HM-PB-4DIS-WM"};
|
||||
,CtOn =>1,CtDlyOn =>1,CtRampOn =>1
|
||||
,CtOff =>1,CtDlyOff =>1,CtRampOff =>1
|
||||
,OffDlyStep =>1,OffDlyNewTime =>1,OffDlyOldTime =>1
|
||||
,lgMultiExec =>1
|
||||
,lgMultiExec =>1,shMultiExec =>1
|
||||
}
|
||||
,"HM-LC-RGBW-WM02" =>{ ActHsvCol =>1
|
||||
,waRed =>1,waGreen =>1,waBlue =>1}
|
||||
|
Loading…
x
Reference in New Issue
Block a user