2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

10_CUL_HM: improve delete handling

git-svn-id: https://svn.fhem.de/fhem/trunk@7146 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2014-12-06 12:01:27 +00:00
parent f4d6a3883f
commit eb92629b5d

View File

@ -499,6 +499,9 @@ sub CUL_HM_Undef($$) {###############################
my ($hash, $name) = @_;
my $devName = $hash->{device};
my $HMid = $hash->{DEF};
CUL_HM_unQEntity($name,"qReqConf");
CUL_HM_unQEntity($name,"qReqStat");
CUL_HM_complConfigTestRm($name);
my $chn = substr($HMid,6,2);
if ($chn){# delete a channel
my $devHash = $defs{$devName};
@ -6967,8 +6970,8 @@ sub CUL_HM_unQEntity($$){# remove entity from q
@chns = grep !/$chn/,@chns;
$dq->{$q} = join",",@chns;
}
my $mQ = $q."Wu" if (CUL_HM_getRxType($defs{$name}) & 0x1C);
$mQ = $modules{CUL_HM}{helper}{$q};
$q = $q."Wu" if (CUL_HM_getRxType($defs{$name}) & 0x1C);
my $mQ = $modules{CUL_HM}{helper}{$q};
@{$mQ} = grep !/^$devN$/,@{$mQ} if ($dq->{$q} eq "");
}
sub CUL_HM_qEntity($$){ # add to queue
@ -7213,6 +7216,13 @@ sub CUL_HM_complConfigTest($){# Q - check register consistancy some time later
InternalTimer(gettimeofday()+ 1800,"CUL_HM_complConfigTO","CUL_HM_complConfigTO", 0);
}
}
sub CUL_HM_complConfigTestRm($){# Q - check register consistancy some time later
my $name = shift;
my $devN = CUL_HM_getDeviceName($name);
return if (AttrVal($devN,"subType","") eq "virtual");
my $mQ = $modules{CUL_HM}{helper}{confCheckArr};
@{$mQ} = grep !/^$name$/,@{$mQ};
}
sub CUL_HM_complConfigTO($) {# now perform consistancy check of register
my @arr = @{$modules{CUL_HM}{helper}{confCheckArr}};
@{$modules{CUL_HM}{helper}{confCheckArr}} = ();