mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 03:06:37 +00:00
loadConfig should use the last, not the first entry
git-svn-id: https://svn.fhem.de/fhem/trunk@5512 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
ab187e521f
commit
5215c31f2f
@ -1905,7 +1905,8 @@ sub CUL_HM_Parse($$) {#########################################################
|
||||
(hex($mFlg)&0x20)){ #response required Flag
|
||||
my ($recChn) = (hex($1));# button number/event count
|
||||
# fhem CUL shall ack a button press
|
||||
push @ack,$shash,$mNo."8002".$dst.$src."0101".(($recChn&1)?"C8":"00")."00";
|
||||
# push @ack,$shash,$mNo."8002".$dst.$src."0101".(($recChn&1)?"C8":"00")."00";
|
||||
push @ack,$shash,$mNo."8002$dst$src"."00";
|
||||
Log3 $name,5,"CUL_HM $name prep ACK for $recChn";
|
||||
}
|
||||
}
|
||||
|
@ -1314,11 +1314,13 @@ sub HMinfo_loadConfig($@) {####################################################
|
||||
my @el = ();
|
||||
my @elincmpl = ();
|
||||
my @entryNF = ();
|
||||
my %changes;
|
||||
my @rUpdate;
|
||||
while(<aSave>){
|
||||
chomp;
|
||||
my $line = $_;
|
||||
next if ( $line !~ m/set .* (peerBulk|regBulk) .*/
|
||||
&& $line !~ m/attr .*/);
|
||||
&& $line !~ m/setreading .*/);
|
||||
my ($cmd1,$eN,$cmd,$param) = split(" ",$line,4);
|
||||
next if ($eN !~ m/$filter/);
|
||||
if (!$eN || !$defs{$eN}){
|
||||
@ -1326,6 +1328,7 @@ sub HMinfo_loadConfig($@) {####################################################
|
||||
next;
|
||||
}
|
||||
if ($cmd1 eq "setreading"){
|
||||
$changes{$eN}{$cmd}=$param if (!$defs{$eN}{READINGS}{$cmd});
|
||||
$defs{$eN}{READINGS}{$cmd}{VAL} = $param;
|
||||
$defs{$eN}{READINGS}{$cmd}{TIME} = "from archive";
|
||||
}
|
||||
@ -1342,26 +1345,36 @@ sub HMinfo_loadConfig($@) {####################################################
|
||||
}
|
||||
}
|
||||
elsif($cmd eq "regBulk"){
|
||||
next if($param !~ m/RegL_0[0-9]:/);
|
||||
|
||||
my $exp = CUL_HM_getAttrInt($eN,"expert");
|
||||
$param =~ s/\.RegL/RegL/;
|
||||
$param =~ s/RegL/\.RegL/ if ($exp != 2);
|
||||
my ($reg,$data) = split(" ",$param,2);
|
||||
my $rl = join",",CUL_HM_reglUsed($eN);
|
||||
my $r2 = $reg;
|
||||
$r2 =~ s/^\.//;
|
||||
|
||||
next if ($rl !~ m/$r2/);
|
||||
|
||||
if ($data !~ m/00:00/){
|
||||
push @elincmpl,"$eN reg list:$reg";
|
||||
next;
|
||||
}
|
||||
if (!$defs{$eN}{READINGS}{$reg}){
|
||||
$changes{$eN}{$reg}=$data if (!$defs{$eN}{READINGS}{$reg});
|
||||
}
|
||||
}
|
||||
close(aSave);
|
||||
foreach my $eN (keys %changes){
|
||||
foreach my $reg (keys %{$changes{$eN}}){
|
||||
$defs{$eN}{READINGS}{$reg}{VAL} = $changes{$eN}{$reg};
|
||||
$defs{$eN}{READINGS}{$reg}{TIME} = "from archive";
|
||||
my ($list,$pN) = ($1,$2) if ($reg =~ m/RegL_(..):(.*)/);
|
||||
my $pId = CUL_HM_peerChId($pN,substr($defs{$eN}{DEF},0,6));
|
||||
$defs{$eN}{READINGS}{$reg}{VAL} = $data;
|
||||
$defs{$eN}{READINGS}{$reg}{TIME} = "from archive";
|
||||
CUL_HM_updtRegDisp($defs{$eN},$list,$pId);
|
||||
push @el,"$eN reg list:$reg";
|
||||
}
|
||||
}
|
||||
}
|
||||
close(aSave);
|
||||
$ret .= "\nadded data:\n " .join("\n ",@el) if (scalar@el);
|
||||
$ret .= "\nfile data incomplete:\n ".join("\n ",@elincmpl) if (scalar@elincmpl);
|
||||
$ret .= "\nentries not defind:\n " .join("\n ",@entryNF) if (scalar@entryNF);
|
||||
|
Loading…
x
Reference in New Issue
Block a user