From c32dad4bd6481f32b7e1800f37c9f6f19bcaee9d Mon Sep 17 00:00:00 2001 From: martinp876 <> Date: Thu, 25 May 2017 17:25:25 +0000 Subject: [PATCH] 10_CUL_HM: update button press long release calculation git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@14372 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/10_CUL_HM.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/FHEM/10_CUL_HM.pm b/FHEM/10_CUL_HM.pm index b52790e89..2b83b0908 100755 --- a/FHEM/10_CUL_HM.pm +++ b/FHEM/10_CUL_HM.pm @@ -2211,7 +2211,8 @@ sub CUL_HM_Parse($$) {######################################################### : "Btn$mh{chn}"; if($type eq "l"){# long press - $state .= ($mh{mFlgH} & 0x20 ? "Release" : ""); + #$state .= ($mh{mFlgH} & 0x20 ? "Release" : "");# not sufficient + $state .= ((($mh{mFlgH} & 0x24) == 0x20) ? "Release" : ""); } push @evtEt,[$mh{devH},1,"battery:$bat"]; @@ -3409,8 +3410,9 @@ 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" + $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"); push @evtEt,[$mhp->{cHash},1,"trigger:".(ucfirst($long))."_$cnt"];