2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-20 13:26:02 +00:00

CUL_HM: virtTh sensor different types - remove bug at startup. Introduce "ignore" handlingvor device - i.e. ignore for a device will set all channels to ignore as well

git-svn-id: https://svn.fhem.de/fhem/trunk@23252 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2020-11-28 19:48:27 +00:00
parent 6c16e23443
commit 44a0e8c53d

View File

@ -423,7 +423,6 @@ sub CUL_HM_updateConfig($){##########################
if ( $hash->{helper}{fkt}
&& $hash->{helper}{fkt} =~ m/^(vdCtrl|virtThSens)$/){
my $vId = substr($id."01",0,8);
$hash->{helper}{virtTC} = "00";
$hash->{helper}{vd}{msgRed}= 0 if(!defined $hash->{helper}{vd}{msgRed});
if(!defined $hash->{helper}{vd}{next}){
($hash->{helper}{vd}{msgCnt},$hash->{helper}{vd}{next}) =
@ -1138,6 +1137,35 @@ sub CUL_HM_Attr(@) {#################################
}
}
}
elsif($attrName eq "ignore"){
if ($init_done){
if ($cmd eq "set"){
$attr{$name}{".ignoreSet"} = $attrVal; # remember user desire
foreach my $chNm(CUL_HM_getAssChnNames($name)){
if( $attrVal == 1){
$attr{$chNm}{$attrName} = 1;
}
elsif( defined $attr{$chNm}{".ignoreSet"}){
$attr{$chNm}{$attrName} = $attr{$chNm}{".ignoreSet"};
}
else{
delete $attr{$chNm}{$attrName};
}
}
}
else {
delete $attr{$name}{".ignoreSet"};
foreach my $chNm(CUL_HM_getAssChnNames($name)){
if( defined $attr{$chNm}{".ignoreSet"}){
$attr{$chNm}{$attrName} = $attr{$chNm}{".ignoreSet"};
}
else{
delete $attr{$chNm}{$attrName};
}
}
}
}
}
CUL_HM_queueUpdtCfg($name) if ($updtReq);
return;
@ -1239,8 +1267,7 @@ sub CUL_HM_hmInitMsgUpdt($){ #update device init msg for HMLAN
sub CUL_HM_Notify(@){#################################
my ($ntfy, $dev) = @_;
return "" if ($dev->{NAME} ne "global");
if ($dev->{NAME} eq "global"){
my $events = deviceEvents($dev, AttrVal($ntfy->{NAME}, "addStateEvent", 0));
return undef if(!$events); # Some previous notify deleted the array.
return undef if (grep !/INITIALIZED/,@{$events});
@ -1252,6 +1279,10 @@ sub CUL_HM_Notify(@){#################################
return undef;
}
else {
return "";
}
}
sub CUL_HM_setupHMLAN(@){#################################
foreach (devspec2array("TYPE=CUL_HM:FILTER=DEF=......:FILTER=subType!=virtual")){
@ -6161,10 +6192,8 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++
$hash->{helper}{vd}{msgRed} = 0 if(!defined $hash->{helper}{vd}{msgRed});
$hash->{helper}{virtTC} = ($cmd eq "valvePos")?"03":"00";
CUL_HM_UpdtReadSingle($hash,"valveCtrl","init",1)
if ($cmd eq "valvePos");
$hash->{helper}{vd}{next} = ReadingsVal($name,".next",gettimeofday())
if (!defined $hash->{helper}{vd}{next});
CUL_HM_UpdtReadSingle($hash,"valveCtrl","init",1) if ($cmd eq "valvePos");
$hash->{helper}{vd}{next} = ReadingsVal($name,".next",gettimeofday()) if (!defined $hash->{helper}{vd}{next});
CUL_HM_valvePosUpdt("valvePos:$dst$chn");
}
$hash->{helper}{virtTC} = ($cmd eq "valvePos")?"03":"00";