From a3d3ba9b648ef51323df5c0aa9fc86f9916ed7c9 Mon Sep 17 00:00:00 2001 From: martinp876 <> Date: Sun, 30 Oct 2016 15:38:10 +0000 Subject: [PATCH] CUL_HM: start msgs to actor after peerChan autmatically git-svn-id: https://svn.fhem.de/fhem/trunk@12472 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/10_CUL_HM.pm | 13 ++++++------- fhem/FHEM/98_HMinfo.pm | 10 +++++----- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/fhem/FHEM/10_CUL_HM.pm b/fhem/FHEM/10_CUL_HM.pm index 15c231023..ecb2de014 100755 --- a/fhem/FHEM/10_CUL_HM.pm +++ b/fhem/FHEM/10_CUL_HM.pm @@ -1815,7 +1815,7 @@ sub CUL_HM_Parse($$) {######################################################### if ($mh{md} =~ m/^(WS550|WS888|HM-WDC7000)/){$chn = "10"} elsif ($mh{md} eq "HM-WDS30-OT2-SM") {$chn = "05";$h=""} elsif ($mh{md} =~ m/^(S550IA|HM-WDS30-T-O)/) {$chn = "01";$h=""} - else {$chn = "01"} + else {$chn = "01"} my $t = $d1 & 0x7fff; $t -= 0x8000 if($t &0x4000); @@ -2984,9 +2984,8 @@ sub CUL_HM_parseCommon(@){##################################################### $response = $response ^ pack("H*", substr($devHlpr->{prt}{rspWait}{cmd}, 24)); $response = $cipher->encrypt(substr($response, 0, 16)); - CUL_HM_SndCmd($mhp->{devH}, $mhp->{mNo}.$mhp->{mFlg}.'03'.CUL_HM_IoId($mhp->{devH}).$mhp->{src}.unpack("H*", $response)); - - $reply = "AES"; + CUL_HM_SndCmd($mhp->{devH}, $mhp->{mNo}.$mhp->{mFlg}.'03'.CUL_HM_IoId($mhp->{devH}).$mhp->{src}.unpack("H*", $response)); + $reply = "AES"; } } elsif ($cryptFunc != 1){ #AES is not available @@ -5805,7 +5804,7 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++ if ($dSet){ CUL_HM_PushCmdStack($peerHash, sprintf("++%s01%s%s%s%s%s%02X00",$peerFlag,$id,$peerDst,$pCh[1],$cmdB,$dst,$b[1])); CUL_HM_PushCmdStack($peerHash, sprintf("++%s01%s%s%s%s%s%02X00",$peerFlag,$id,$peerDst,$pCh[2],$cmdB,$dst,$b[2] )); - } + } else{ CUL_HM_PushCmdStack($peerHash, sprintf("++%s01%s%s%s%s%s%02X%02X",$peerFlag,$id,$peerDst,$pCh[1],$cmdB,$dst,$b[2],$b[1] )); } @@ -5815,7 +5814,7 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++ } CUL_HM_qAutoRead($peerHash->{NAME},3); } - $devHash = $peerHash; # Exchange the hash, as the switch is always alive. + $devHash = CUL_HM_getDeviceHash($peerHash); # Exchange the hash, as the switch is always alive. } } return ("",1) if ($target && $target eq "remote");#Nothing for actor @@ -6461,7 +6460,7 @@ sub CUL_HM_responseSetup($$) {#store all we need to handle the response CUL_HM_respWaitSu ($hash,"cmd:=$cmd","mNo:=$mNo","reSent:=$rss"); } - CUL_HM_protState($hash,"CMDs_processing..."); + CUL_HM_protState($hash,"CMDs_processing...");#if($mTp ne '03'); } else{# no answer expected if($hash->{cmdStack} && scalar @{$hash->{cmdStack}}){ diff --git a/fhem/FHEM/98_HMinfo.pm b/fhem/FHEM/98_HMinfo.pm index 2052e308e..5491b2a4a 100644 --- a/fhem/FHEM/98_HMinfo.pm +++ b/fhem/FHEM/98_HMinfo.pm @@ -68,7 +68,7 @@ sub HMinfo_Define($$){######################################################### $hash->{nb}{cnt} = 0; return; } -sub HMinfo_Undef($$){######################################################### +sub HMinfo_Undef($$){########################################################## my ($hash, $name) = @_; return undef; } @@ -186,7 +186,7 @@ sub HMinfo_Attr(@) {########################################################### return; } -sub HMinfo_Notify(@){################################# +sub HMinfo_Notify(@){########################################################## my ($ntfy, $dev) = @_; return "" if ($dev->{NAME} ne "global"); @@ -892,7 +892,7 @@ sub HMinfo_tempListTmplView() { ############################################### $ret .= "\ndevices not using tempList templates:\n => " .join("\n => ",@dWoTmpl) if (@dWoTmpl); return $ret; } -sub HMinfo_tempListDefFn(@) { ########################################### +sub HMinfo_tempListDefFn(@) { ################################################# #return Default filename for tempList my ($fn) = shift; $fn = "" if (!defined $fn); @@ -906,7 +906,7 @@ sub HMinfo_tempListDefFn(@) { ########################################### } return $ret.$fn; } -sub HMinfo_listOfTempTemplates() { ########################################### +sub HMinfo_listOfTempTemplates() { ############################################ # search all entries in tempListFile my ($n) =devspec2array("TYPE=HMinfo"); my $dir = AttrVal($n,"configDir","$attr{global}{modpath}/")."/"; #no dir? add defDir @@ -1719,7 +1719,7 @@ sub HMInfo_help(){ ############################################################ ; } -sub HMinfo_verifyConfig($) {################################################## +sub HMinfo_verifyConfig($) {################################################### my ($param) = @_; my ($id,$fName) = split ",",$param; HMinfo_purgeConfig($param);