From c3c828b8f01ed5f07e6f037588adde4724965dbd Mon Sep 17 00:00:00 2001 From: martinp876 <> Date: Sun, 2 Jul 2017 13:19:36 +0000 Subject: [PATCH] 10_CUL_HM:change count for longRelease - do not count the release git-svn-id: https://svn.fhem.de/fhem/trunk@14626 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/10_CUL_HM.pm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/fhem/FHEM/10_CUL_HM.pm b/fhem/FHEM/10_CUL_HM.pm index 8c2f30d8e..26ce08a68 100755 --- a/fhem/FHEM/10_CUL_HM.pm +++ b/fhem/FHEM/10_CUL_HM.pm @@ -2843,7 +2843,7 @@ sub CUL_HM_Parse($$) {######################################################### $stAck = '01'.$dChNo.(($stT eq "ON")?"C8":"00")."00" } - if ($mh{mFlgH} & 0x20){ + if ((($mh{mFlgH} & 0x24) == 0x20)){ $longPress .= "_Release"; $dChHash->{helper}{trgLgRpt}=0; push @ack,$mh{shash},$mh{mNo}."8002".$mh{dst}.$mh{src}.$stAck; @@ -3430,10 +3430,13 @@ sub CUL_HM_parseCommon(@){##################################################### $mhp->{cHash}{helper}{BNO} = $cnt; $mhp->{cHash}{helper}{BNOCNT} = 0; # message counter reset } - $mhp->{cHash}{helper}{BNOCNT} += 1; - #$state .= ($mhp->{mFlgH} & 0x20 ? "Release" : "")." $mhp->{cHash}{helper}{BNOCNT}_$cnt" # not sufficient - $state .= ((($mhp->{mFlgH} & 0x24) == 0x20) ? "Release" : "")." $mhp->{cHash}{helper}{BNOCNT}_$cnt" - if($long eq "long"); + if (($mhp->{mFlgH} & 0x24) == 0x20 && ($long eq "long")){ # release long press + $state .= "Release"; + } + else{ # continue long press + $mhp->{cHash}{helper}{BNOCNT} += 1; + } + $state .= " $mhp->{cHash}{helper}{BNOCNT}_$cnt"; push @evtEt,[$mhp->{cHash},1,"trigger:".(ucfirst($long))."_$cnt"]; push @evtEt,[$mhp->{cHash},1,"state:".$state." (to $mhp->{dstN})"] if ($mhp->{devH} ne $mhp->{cHash});