2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-18 05:56:03 +00:00

some bugs

git-svn-id: https://svn.fhem.de/fhem/trunk@4912 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2014-02-13 19:33:59 +00:00
parent fb48bd7860
commit 30a7f7e61d
3 changed files with 45 additions and 19 deletions

View File

@ -27,7 +27,6 @@ sub HMLAN_secSince2000();
sub HMLAN_relOvrLd($);
sub HMLAN_condUpdate($$);
my $debug = 1; # set 1 for better log readability
my %sets = ( "hmPairForSec" => "HomeMatic"
,"hmPairSerial" => "HomeMatic"
);
@ -403,7 +402,7 @@ sub HMLAN_Write($$$) {#########################################################
&& $hash->{assignedIDs} =~ m/$dst/){
# Acks are generally send by HMLAN autonomously
# Special
Log3 $hash, 5, "HMLAN: Skip ACK" if (!$debug);
Log3 $hash, 5, "HMLAN: Skip ACK";
return;
}
# my $IDHM = '+'.$dst.',01,00,F1EF'; #used by HMconfig - meanning??
@ -447,7 +446,7 @@ sub HMLAN_Read($) {############################################################
my $name = $hash->{NAME};
my $hmdata = $hash->{PARTIAL};
Log3 $hash, 5, "HMLAN/RAW: $hmdata/$buf" if (!$debug);
Log3 $hash, 5, "HMLAN/RAW: $hmdata/$buf";
$hmdata .= $buf;
while($hmdata =~ m/\n/) {

View File

@ -679,7 +679,7 @@ sub CUL_HM_Parse($$) {##############################
if( defined $dhash->{helper}{cSnd} &&
$dhash->{helper}{cSnd} ne substr($msg,7)){
Log3 $dname,6,"CUL_HM $dname attack:$dhash->{helper}{cSnd}:".substr($msg,7).".";
Log3 $dname,5,"CUL_HM $dname attack:$dhash->{helper}{cSnd}:".substr($msg,7).".";
CUL_HM_eventP($dhash,"ErrIoAttack");
my ($evntCnt,undef) = split(' last_at:',$dhash->{"prot"."ErrIoAttack"},2);
push @entities,CUL_HM_UpdtReadSingle($dhash,"sabotageAttack","ErrIoAttack cnt:$evntCnt",1);
@ -1728,6 +1728,7 @@ sub CUL_HM_Parse($$) {##############################
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";
Log3 $name,5,"CUL_HM $name prep ACK for $recChn";
}
}
@ -1749,7 +1750,7 @@ sub CUL_HM_Parse($$) {##############################
my $rr = $respRemoved;
CUL_HM_SndCmd($ack[$i++],$ack[$i++])while ($i<@ack);
$respRemoved = $rr;
Log3 $name,6,"CUL_HM $name sent ACK:".(int(@ack));
Log3 $name,5,"CUL_HM $name sent ACK:".(int(@ack));
}
CUL_HM_ProcessCmdStack($shash) if ($respRemoved); # cont if complete
#------------ process events ------------------
@ -3566,7 +3567,6 @@ sub CUL_HM_Set($@) {
}
$peerHash = $modules{CUL_HM}{defptr}{$peerDst.$peerChn}if ($modules{CUL_HM}{defptr}{$peerDst.$peerChn});
$peerHash = $modules{CUL_HM}{defptr}{$peerDst} if (!$peerHash);
Log 1,"General $peerN t:$peerHash->{TYPE} d:$devName i:$defs{$devName}{IODev}->{NAME}";
return "$peerN not a CUL_HM device" if( ($target ne "remote")
&& (!$peerHash || $peerHash->{TYPE} ne "CUL_HM")
&& $defs{$devName}{IODev}->{NAME} ne $peerN);
@ -4482,7 +4482,7 @@ sub CUL_HM_protState($$){
CUL_HM_UpdtReadSingle($hash,"state",$state,0);
DoTrigger($name, undef);
}
Log3 $name,6,"CUL_HM $name protEvent:$state".
Log3 $name,5,"CUL_HM $name protEvent:$state".
($hash->{cmdStack}?" pending:".scalar @{$hash->{cmdStack}}:"");
}
@ -5289,7 +5289,7 @@ sub CUL_HM_TCITtempReadings($) {# parse RT temperature readings
my $stmpRegs = ($hash->{helper}{shadowReg}{"RegL_0$lst:"})? # need to compare actual data
($hash->{helper}{shadowReg}{"RegL_0$lst:"})
:$tempRegs;
# return "reglist incomplete\n" if ($tempRegs !~ m/00:00/);
next if ($tempRegs !~ m/00:00/);
my @days = ("Sat", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri");

View File

@ -22,6 +22,7 @@ sub HMinfo_Initialize($$) {####################################################
$hash->{DefFn} = "HMinfo_Define";
$hash->{SetFn} = "HMinfo_SetFn";
$hash->{GetFn} = "HMinfo_GetFn";
$hash->{AttrFn} = "HMinfo_Attr";
$hash->{AttrList} = "loglevel:0,1,2,3,4,5,6 "
."sumStatus sumERROR "
@ -57,7 +58,7 @@ sub HMinfo_Define($$){#########################################################
$hash->{nb}{cnt} = 0;
return;
}
sub HMinfo_Attr(@) {#################################
sub HMinfo_Attr(@) {###########################################################
my ($cmd,$name, $attrName,$attrVal) = @_;
my @hashL;
my $hash = $defs{$name};
@ -287,21 +288,21 @@ sub HMinfo_tempList(@) { ######################################################
$filter = "." if (!$filter);
$action = "" if (!$action);
my $ret;
if ($action eq "save"){
if ($action eq "save"){
open(aSave, ">$fName") || return("Can't open $fName: $!");
my @incmpl;
foreach my $eN(HMinfo_getEntities("d")){#search for devices and select correct channel
foreach my $eN(HMinfo_getEntities("d")){#search and select channel
my $md = AttrVal($eN,"model","");
my $chN; #tempList channel name
if ($md =~ m/(HM-CC-RT-DN-BoM|HM-CC-RT-DN)/){
$chN = $defs{$eN}{channel_04};
}
elsif ($md =~ m/(ROTO_ZEL-STG-RM-FWT|HM-CC-TC)/){
elsif ($md =~ m/(ROTO_ZEL-STG-RM-FWT|HM-CC-TC|HM-TC-IT-WM-W-EU)/){
$chN = $defs{$eN}{channel_02};
}
next if (!$chN || !$defs{$chN} || $chN !~ m/$filter/);
print aSave "\nentities:$chN";
my @tl = sort grep /tempList[SMFWT]/,keys %{$defs{$chN}{READINGS}};
my @tl = sort grep /tempList(P[123])?[SMFWT]/,keys %{$defs{$chN}{READINGS}};
if (scalar@tl != 7){
print aSave "\nincomplete:$chN only data for ".join(",",@tl);
push @incmpl,$chN;
@ -337,7 +338,7 @@ sub HMinfo_tempList(@) { ######################################################
}
push @elAll,@el;
}
elsif(@el && $_ =~ m/tempList[SMFWT].*\>/){
elsif(@el && $_ =~ m/tempList(P[123])?[SMFWT].*\>/){
my ($tln,$val) = ($1,$2)if($_ =~ m/(.*)>(.*)/);
$tln =~ s/ //g;
$val =~ s/ //g;
@ -379,7 +380,7 @@ sub HMinfo_tempList(@) { ######################################################
}
push @elAll,@el;
}
elsif(@el && $_ =~ m/tempList[SMFWT].*\>/){
elsif(@el && $_ =~ m/tempList(P[123])?[SMFWT].*\>/){
my ($tln,$val) = ($1,$2)if($_ =~ m/(.*)>(.*)/);
$tln =~ s/ //g;
$val =~ tr/ +/ /;
@ -436,7 +437,7 @@ sub HMinfo_tempListTmpl(@) { ##################################################
$found = 1 if ($defs{$_} && $_ eq $tmpl);
}
}
elsif($found != 1 && $_ =~ m/tempList[SMFWT].*\>/){
elsif($found != 1 && $_ =~ m/tempList(P[123])?[SMFWT].*\>/){
my ($tln,$val) = ($1,$2)if($_ =~ m/(.*)>(.*)/);
$tln =~ s/ //g;
$val =~ tr/ +/ /;
@ -508,7 +509,6 @@ sub HMinfo_getEntities(@) { ###################################################
}
return sort(@names);
}
sub HMinfo_getMsgStat() { #####################################################
my ($hr,$dr,$hs,$ds);
$hr = sprintf("\n %-14s:","receive hour");
@ -547,6 +547,33 @@ sub HMinfo_getMsgStat() { #####################################################
.$dr.$ds
;
}
sub HMinfo_GetFn($@) {#########################################################
my ($hash,$name,$cmd,@a) = @_;
my ($opt,$optEmpty,$filter) = ("",1,"");
my $ret;
if (@a && ($a[0] =~ m/^-/) && ($a[0] !~ m/^-f$/)){# options provided
$opt = $a[0];
$optEmpty = ($opt =~ m/e/)?1:0;
shift @a; #remove
}
if (@a && $a[0] =~ m/^-f$/){# options provided
shift @a; #remove
$filter = shift @a;
}
$cmd = "?" if(!$cmd);# by default print options
if ($cmd eq "unused" ) {##actionImmediate: clear parameter--------------
}
else{
my @cmdLst =
( "notsupproted");
$ret = join (" ",sort @cmdLst);
}
return $ret;
}
sub HMinfo_SetFn($@) {#########################################################
my ($hash,$name,$cmd,@a) = @_;
my ($opt,$optEmpty,$filter) = ("",1,"");
@ -870,7 +897,7 @@ sub HMinfo_SetFn($@) {#########################################################
$fn = AttrVal($name,"configDir",".")."\/".$fn if ($fn !~ m/\//);
$ret = HMinfo_tempList($filter,$a[0],$fn);
}
elsif($cmd eq "tempListTmpl"){##handle thermostat templist from file ---------
elsif($cmd eq "tempListTmpl"){##handle thermostat templist from file --------
my $fn = $a[1]?$a[1]:"tempList.cfg";
$fn = AttrVal($name,"configDir",".")."\/".$fn if ($fn !~ m/\//);
$ret = HMinfo_tempListTmpl($filter,$a[0],$fn);
@ -1103,7 +1130,7 @@ sub HMinfo_saveConfig($) {#####################################################
return $id;
}
sub HMinfo_archConfig($$$$) {################################################
sub HMinfo_archConfig($$$$) {##################################################
# save config only if register are complete
my ($hash,$name,$opt,$fN) = @_;
$fN = $fN?$fN:AttrVal($name,"configFilename","regSave.cfg");