improve hmmanualOper, hminfo protostatus
git-svn-id: https://svn.fhem.de/fhem/trunk@4754 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -195,38 +195,26 @@ sub CUL_HM_updateConfig($){
|
|||||||
next if (!$hash->{DEF}); # likely renamed
|
next if (!$hash->{DEF}); # likely renamed
|
||||||
|
|
||||||
my $id = $hash->{DEF};
|
my $id = $hash->{DEF};
|
||||||
my $chn = substr($id."00",6,2);
|
my $nAttr = $modules{CUL_HM}{helper}{hmManualOper};# no update for attr
|
||||||
|
|
||||||
if ($id ne $K_actDetID){# if not action detector
|
if ($id eq $K_actDetID){# if action detector
|
||||||
CUL_HM_ID2PeerList($name,"",1); # update peerList out of peerIDs
|
|
||||||
my $actCycle = AttrVal($name,"actCycle",undef);
|
|
||||||
CUL_HM_ActAdd($id,$actCycle) if ($actCycle);# add to ActionDetect?
|
|
||||||
# --- set default attrubutes if missing ---
|
|
||||||
if ( $hash->{helper}{role}{dev}
|
|
||||||
&& AttrVal($name,"subType","") ne "virtual"){
|
|
||||||
$attr{$name}{expert} = AttrVal($name,"expert" ,"2_full");
|
|
||||||
$attr{$name}{autoReadReg}= AttrVal($name,"autoReadReg","4_reqStatus");
|
|
||||||
}
|
|
||||||
CUL_HM_Attr("attr",$name,"expert",$attr{$name}{expert})
|
|
||||||
if ($attr{$name}{expert});#need update after readings are available
|
|
||||||
}
|
|
||||||
else{# Action Detector only
|
|
||||||
$attr{$name}{"event-on-change-reading"} =
|
$attr{$name}{"event-on-change-reading"} =
|
||||||
AttrVal($name, "event-on-change-reading", ".*");
|
AttrVal($name, "event-on-change-reading", ".*")
|
||||||
|
if(!$nAttr);
|
||||||
delete $hash->{helper}{role};
|
delete $hash->{helper}{role};
|
||||||
$hash->{helper}{role}{vrt} = 1;
|
$hash->{helper}{role}{vrt} = 1;
|
||||||
next;
|
next;
|
||||||
#delete $attr{$name}{peerIDs}; # remove historical data
|
|
||||||
}
|
}
|
||||||
|
CUL_HM_ID2PeerList($name,"",1); # update peerList out of peerIDs
|
||||||
|
|
||||||
|
my $chn = substr($id."00",6,2);
|
||||||
my $st = CUL_HM_Get($hash,$name,"param","subType");
|
my $st = CUL_HM_Get($hash,$name,"param","subType");
|
||||||
my $md = CUL_HM_Get($hash,$name,"param","model");
|
my $md = CUL_HM_Get($hash,$name,"param","model");
|
||||||
if ($md =~ /(HM-CC-TC|ROTO_ZEL-STG-RM-FWT)/){
|
|
||||||
|
if ($md =~ /(HM-CC-TC|ROTO_ZEL-STG-RM-FWT)/){
|
||||||
$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 ($md =~ m/HM-CC-RT-DN/){
|
elsif ($md =~ m/HM-CC-RT-DN/){
|
||||||
$attr{$name}{stateFormat} = "last:trigLast" if ($chn eq "03");
|
|
||||||
$hash->{helper}{shRegR}{"07"} = "00" if ($chn eq "04");# shadowReg List 7 read from CH 0
|
$hash->{helper}{shRegR}{"07"} = "00" if ($chn eq "04");# shadowReg List 7 read from CH 0
|
||||||
$hash->{helper}{shRegW}{"07"} = "04" if ($chn eq "00");# shadowReg List 7 write to CH 4
|
$hash->{helper}{shRegW}{"07"} = "04" if ($chn eq "00");# shadowReg List 7 write to CH 4
|
||||||
}
|
}
|
||||||
@@ -273,6 +261,24 @@ sub CUL_HM_updateConfig($){
|
|||||||
$hash->{helper}{role}{vrt} = 1;
|
$hash->{helper}{role}{vrt} = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
next if ($nAttr);# stop if default setting if attributes is not desired
|
||||||
|
|
||||||
|
my $actCycle = AttrVal($name,"actCycle",undef);
|
||||||
|
CUL_HM_ActAdd($id,$actCycle) if ($actCycle );#add 2 ActionDetect?
|
||||||
|
# --- set default attrubutes if missing ---
|
||||||
|
if ( $hash->{helper}{role}{dev}
|
||||||
|
&& AttrVal($name,"subType","") ne "virtual"){
|
||||||
|
$attr{$name}{expert} = AttrVal($name,"expert" ,"2_full");
|
||||||
|
$attr{$name}{autoReadReg}= AttrVal($name,"autoReadReg","4_reqStatus");
|
||||||
|
}
|
||||||
|
CUL_HM_Attr("attr",$name,"expert",$attr{$name}{expert})
|
||||||
|
if ($attr{$name}{expert});#need update after readings are available
|
||||||
|
|
||||||
|
if ($chn eq "03" &&
|
||||||
|
$md =~ /(HM-CC-TC|ROTO_ZEL-STG-RM-FWT|HM-CC-RT-DN)/){
|
||||||
|
$attr{$name}{stateFormat} = "last:trigLast";
|
||||||
|
}
|
||||||
|
|
||||||
if ( $hash->{helper}{role}{dev} && CUL_HM_getRxType($hash)&0x02){#burst dev
|
if ( $hash->{helper}{role}{dev} && CUL_HM_getRxType($hash)&0x02){#burst dev
|
||||||
#burst devices must restrict retries!
|
#burst devices must restrict retries!
|
||||||
$attr{$name}{msgRepeat} = 1 if (!$attr{$name}{msgRepeat});
|
$attr{$name}{msgRepeat} = 1 if (!$attr{$name}{msgRepeat});
|
||||||
@@ -2034,16 +2040,17 @@ sub CUL_HM_queueUpdtCfg($){
|
|||||||
my $name = shift;
|
my $name = shift;
|
||||||
if ($modules{CUL_HM}{helper}{hmManualOper}){ # no update when manual operation
|
if ($modules{CUL_HM}{helper}{hmManualOper}){ # no update when manual operation
|
||||||
delete $modules{CUL_HM}{helper}{updtCfgLst};
|
delete $modules{CUL_HM}{helper}{updtCfgLst};
|
||||||
return;
|
|
||||||
}
|
|
||||||
my @arr;
|
|
||||||
if ($modules{CUL_HM}{helper}{updtCfgLst}){
|
|
||||||
@arr = CUL_HM_noDup((@{$modules{CUL_HM}{helper}{updtCfgLst}}, $name));
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
push @arr,$name;
|
my @arr;
|
||||||
|
if ($modules{CUL_HM}{helper}{updtCfgLst}){
|
||||||
|
@arr = CUL_HM_noDup((@{$modules{CUL_HM}{helper}{updtCfgLst}}, $name));
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
push @arr,$name;
|
||||||
|
}
|
||||||
|
$modules{CUL_HM}{helper}{updtCfgLst} = \@arr;
|
||||||
}
|
}
|
||||||
$modules{CUL_HM}{helper}{updtCfgLst} = \@arr;
|
|
||||||
RemoveInternalTimer("updateConfig");
|
RemoveInternalTimer("updateConfig");
|
||||||
InternalTimer(gettimeofday()+5,"CUL_HM_updateConfig", "updateConfig", 0);
|
InternalTimer(gettimeofday()+5,"CUL_HM_updateConfig", "updateConfig", 0);
|
||||||
}
|
}
|
||||||
@@ -5613,7 +5620,6 @@ sub CUL_HM_peersValid($) {# is list valid?
|
|||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub CUL_HM_reglUsed($) {# provide data for HMinfo
|
sub CUL_HM_reglUsed($) {# provide data for HMinfo
|
||||||
my $name = shift;
|
my $name = shift;
|
||||||
my $hash = $defs{$name};
|
my $hash = $defs{$name};
|
||||||
@@ -5654,7 +5660,7 @@ sub CUL_HM_reglUsed($) {# provide data for HMinfo
|
|||||||
return @lsNo;
|
return @lsNo;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub CUL_HM_complConfigTest($){#
|
sub CUL_HM_complConfigTest($){# Q - check register consistancy some time later
|
||||||
my $name = shift;
|
my $name = shift;
|
||||||
return if ($modules{CUL_HM}{helper}{hmManualOper});#no autoaction when manual
|
return if ($modules{CUL_HM}{helper}{hmManualOper});#no autoaction when manual
|
||||||
push @{$modules{CUL_HM}{helper}{confCheckArr}},$name;
|
push @{$modules{CUL_HM}{helper}{confCheckArr}},$name;
|
||||||
@@ -5663,12 +5669,12 @@ sub CUL_HM_complConfigTest($){#
|
|||||||
InternalTimer(gettimeofday()+ 1800,"CUL_HM_complConfigTO","CUL_HM_complConfigTO", 0);
|
InternalTimer(gettimeofday()+ 1800,"CUL_HM_complConfigTO","CUL_HM_complConfigTO", 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sub CUL_HM_complConfigTO($){
|
sub CUL_HM_complConfigTO($) {# now perform consistancy check of register
|
||||||
my @arr = @{$modules{CUL_HM}{helper}{confCheckArr}};
|
my @arr = @{$modules{CUL_HM}{helper}{confCheckArr}};
|
||||||
@{$modules{CUL_HM}{helper}{confCheckArr}} = ();
|
@{$modules{CUL_HM}{helper}{confCheckArr}} = ();
|
||||||
CUL_HM_complConfig($_) foreach (CUL_HM_noDup(@arr));
|
CUL_HM_complConfig($_) foreach (CUL_HM_noDup(@arr));
|
||||||
}
|
}
|
||||||
sub CUL_HM_complConfig($) {# read config if enabled and not complete
|
sub CUL_HM_complConfig($) {# read config if enabled and not complete
|
||||||
my $name = shift;
|
my $name = shift;
|
||||||
return if ($modules{CUL_HM}{helper}{hmManualOper});#no autoaction when manual
|
return if ($modules{CUL_HM}{helper}{hmManualOper});#no autoaction when manual
|
||||||
return if ((CUL_HM_getAttrInt($name,"autoReadReg") & 0x07) < 5);
|
return if ((CUL_HM_getAttrInt($name,"autoReadReg") & 0x07) < 5);
|
||||||
|
|||||||
@@ -519,7 +519,7 @@ sub HMinfo_SetFn($@) {#########################################################
|
|||||||
$opt .= "d" if ($type !~ m/(readings|register)/);# readings apply to all, others device only
|
$opt .= "d" if ($type !~ m/(readings|register)/);# readings apply to all, others device only
|
||||||
my @entities;
|
my @entities;
|
||||||
$type = "msgEvents" if ($type eq "Protocol");# translate parameter
|
$type = "msgEvents" if ($type eq "Protocol");# translate parameter
|
||||||
foreach my $dName (HMinfo_getEntities($opt."v",$filter)){
|
foreach my $dName (HMinfo_getEntities($opt,$filter)){
|
||||||
push @entities,$dName;
|
push @entities,$dName;
|
||||||
CUL_HM_Set($defs{$dName},$dName,"clear",$type);
|
CUL_HM_Set($defs{$dName},$dName,"clear",$type);
|
||||||
}
|
}
|
||||||
@@ -543,7 +543,7 @@ sub HMinfo_SetFn($@) {#########################################################
|
|||||||
my @paramList;
|
my @paramList;
|
||||||
my @IOlist;
|
my @IOlist;
|
||||||
my @plSum; push @plSum,0 for (0..9);#prefill
|
my @plSum; push @plSum,0 for (0..9);#prefill
|
||||||
foreach my $dName (HMinfo_getEntities($opt."dv",$filter)){
|
foreach my $dName (HMinfo_getEntities($opt."d",$filter)){
|
||||||
my $id = $defs{$dName}{DEF};
|
my $id = $defs{$dName}{DEF};
|
||||||
my ($found,$para) = HMinfo_getParam($id,
|
my ($found,$para) = HMinfo_getParam($id,
|
||||||
,"protState","protCmdPend"
|
,"protState","protCmdPend"
|
||||||
|
|||||||
Reference in New Issue
Block a user