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

delay autogeneration of chans to obey global queue issues

git-svn-id: https://svn.fhem.de/fhem/trunk@2101 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2012-11-08 22:09:18 +00:00
parent aabd18e068
commit d213e364e8

View File

@ -2348,7 +2348,9 @@ CUL_HM_infoUpdtDevData($$$){
$mId = CUL_HM_getMId($hash);# set helper valiable and use result $mId = CUL_HM_getMId($hash);# set helper valiable and use result
# autocreate undefined channels # autocreate undefined channels
Log 1,"General start timer";
my @chanTypesList = split(',',$culHmModel{$mId}{chn}); my @chanTypesList = split(',',$culHmModel{$mId}{chn});
my $startime = gettimeofday()+1;
foreach my $chantype (@chanTypesList){ foreach my $chantype (@chanTypesList){
my ($chnTpName,$chnStart,$chnEnd) = split(':',$chantype); my ($chnTpName,$chnStart,$chnEnd) = split(':',$chantype);
my $chnNoTyp = 1; my $chnNoTyp = 1;
@ -2357,7 +2359,10 @@ CUL_HM_infoUpdtDevData($$$){
if (!$modules{CUL_HM}{defptr}{$chnId}){ if (!$modules{CUL_HM}{defptr}{$chnId}){
my $chnName = $name."_".$chnTpName.(($chnStart == $chnEnd)? my $chnName = $name."_".$chnTpName.(($chnStart == $chnEnd)?
'':'_'.sprintf("%02d",$chnNoTyp)); '':'_'.sprintf("%02d",$chnNoTyp));
DoTrigger("global", 'UNDEFINED '.$chnName.' CUL_HM '.$chnId); InternalTimer($startime++,"CUL_HM_infoUpdtChanData",
"$chnName,$chnId,$model",0);
Log 1,"General timer:$chnName,$chnId,$model";
#DoTrigger("global", 'UNDEFINED '.$chnName.' CUL_HM '.$chnId);
} }
$attr{CUL_HM_id2Name($chnId)}{model} = $model; $attr{CUL_HM_id2Name($chnId)}{model} = $model;
$chnNoTyp++; $chnNoTyp++;
@ -2368,6 +2373,15 @@ CUL_HM_infoUpdtDevData($$$){
} }
} }
sub
CUL_HM_infoUpdtChanData(@)
{# delay this to ensure the device is already available
my($in ) = @_;
my($chnName,$chnId,$model ) = split(',',$in);
Log 1,"General updateChannel:".$chnName;
DoTrigger("global", 'UNDEFINED '.$chnName.' CUL_HM '.$chnId);
$attr{CUL_HM_id2Name($chnId)}{model} = $model;
}
################################### ###################################
sub sub
CUL_HM_Pair(@) CUL_HM_Pair(@)