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

correct templist handling

git-svn-id: https://svn.fhem.de/fhem/trunk@5298 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2014-03-22 18:22:45 +00:00
parent be947f5bad
commit 6f76fb4cb8
2 changed files with 32 additions and 23 deletions

View File

@ -3710,7 +3710,7 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++
Log3 $name,2,"CUL_HM fwUpdate started for $name";
CUL_HM_SndCmd($hash, sprintf("%02X",$modules{CUL_HM}{helper}{updateNbr})
."3011$id${dst}CA");
# InternalTimer(gettimeofday()+0.3,"CUL_HM_FWupdateSim",$dst.$id."00",0);
#InternalTimer(gettimeofday()+0.3,"CUL_HM_FWupdateSim",$dst."00000000",0);
}
elsif($cmd eq "postEvent") { ################################################
my (undef,undef,$cond) = @a;
@ -4680,6 +4680,7 @@ sub CUL_HM_FWupdateSteps($){#steps for FW update
$modules{CUL_HM}{helper}{updateStep}++;
$modules{CUL_HM}{helper}{updateNbr} = $mNo;
RemoveInternalTimer("fail:notInBootLoader");
#InternalTimer(gettimeofday()+0.3,"CUL_HM_FWupdateSim","${dst}${id}00",0);
InternalTimer(gettimeofday()+5,"CUL_HM_FWupdateEnd","fail:SpeedChangeFailed",0);
}
else{# check response - start programming
@ -4750,7 +4751,13 @@ sub CUL_HM_FWupdateSim($){#end FW Simulation
my $msg = shift;
my $ioName = $defs{$modules{CUL_HM}{helper}{updatingName}}->{IODev}->{NAME};
my $mNo = sprintf("%02X",$modules{CUL_HM}{helper}{updateNbr});
CUL_HM_Parse($defs{$ioName},"A00${mNo}8002$msg");
if (0 == $modules{CUL_HM}{helper}{updateStep}){
CUL_HM_Parse($defs{$ioName},"A00${mNo}0010$msg");
}
else{
Log3 "",5,"FWupdate simulate No:$mNo";
CUL_HM_Parse($defs{$ioName},"A00${mNo}8002$msg");
}
}

View File

@ -523,14 +523,14 @@ sub HMinfo_tempList(@) { ######################################################
}
push @elAll,@el;
}
elsif(@el && $_ =~ m/tempList(P[123])?[SMFWT].*\>/){
elsif(@el && $_ =~ m/R_(P[123])?_?._tempList[SMFWT].*\>/){
my ($tln,$val) = ($1,$2)if($_ =~ m/(.*)>(.*)/);
$tln =~ s/ //g;
$val =~ s/ //g;
foreach my $eN(@el){
my $valR = ReadingsVal($eN,$tln,"");
$valR =~ s/ //g;
push @entryFail,$eN." :".$tln if ($valR ne $val);
push (@entryFail,$eN." :".$tln) if ($valR ne $val);
}
}
}
@ -547,8 +547,8 @@ sub HMinfo_tempList(@) { ######################################################
my @exec = ();
while(<aSave>){
chomp;
if($_ =~ m/^entities:/){
my $line = $_;
my $line = $_;
if($line =~ m/^entities:/){
$line =~s/.*://;
@el = ();
foreach (split(",",$line)){
@ -559,26 +559,26 @@ sub HMinfo_tempList(@) { ######################################################
push @entryNF,$_;
}
}
foreach (@exec){
my @param = split(" ",$_);
CUL_HM_Set($defs{$param[0]},@param);
}
push @elAll,@el;
}
elsif(@el && $_ =~ m/tempList(P[123])?[SMFWT].*\>/){
my ($tln,$val) = ($1,$2)if($_ =~ m/(.*)>(.*)/);
elsif(@el && $line =~ m/R_(P[123])?_?._tempList[SMFWT].*\>/){
my ($tln,$val) = ($1,$2)if($line =~ m/(.*)>(.*)/);
$tln =~ s/ //g;
$val =~ tr/ +/ /;
$val =~ s/^ //;
$val =~ s/ $//;
@exec = ();
foreach my $eN(@el){
if ($tln =~ m/tempList(P.)/){
if ($tln =~ m/(P.)_._tempList/){
$val = lc($1)." ".$val;
$tln =~ s/P.//;
}
$tln =~ s/R_(P._)?._//;
my $x = CUL_HM_Set($defs{$eN},$eN,$tln,"prep",split(" ",$val));
push @entryFail,$eN." :".$tln." respose:$x" if ($x != 1);
if ($x ne "1"){
my $list =$line;
$list =~ s/\>.*//;
push @entryFail,$eN." :".$list." respose:$x";
}
push @exec,$eN." ".$tln." exec ".$val;
}
}
@ -628,7 +628,7 @@ sub HMinfo_tempListTmpl(@) { ##################################################
$found = 1 if ($defs{$_} && $_ eq $tmpl);
}
}
elsif($found != 1 && $_ =~ m/tempList(P[123])?[SMFWT].*\>/){
elsif($found != 1 && $_ =~ m/R_(P[123])?_?._tempList[SMFWT].*\>/){
my ($tln,$val) = ($1,$2)if($_ =~ m/(.*)>(.*)/);
$tln =~ s/ //g;
$val =~ tr/ +/ /;
@ -636,19 +636,21 @@ sub HMinfo_tempListTmpl(@) { ##################################################
$val =~ s/ $//;
@exec = ();
foreach my $eN(@el){
if ($tln =~ m/(P.)_._tempList/){
$val = lc($1)." ".$val;
}
$tln =~ s/R_(P._)?._//;
my $x = CUL_HM_Set($defs{$eN},$eN,$tln,"prep",split(" ",$val));
push @entryFail,$eN." :".$tln." respose:$x" if ($x != 1);
push @entryFail,$eN." :".$tln." respose:$x" if ($x ne "1");
push @exec,$eN." ".$tln." exec ".$val;
}
}
foreach (@exec){
my @param = split(" ",$_);
CUL_HM_Set($defs{$param[0]},@param);
}
$ret = "failed Entries:\n " .join("\n ",@entryFail) if (scalar@entryFail);
}
foreach (@exec){
my @param = split(" ",$_);
CUL_HM_Set($defs{$param[0]},@param);
}
close(aSave);
return $ret;
}