2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-25 22:09:21 +00:00

10_CUL_HM: update button press long release calculation

git-svn-id: https://svn.fhem.de/fhem/trunk@14372 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2017-05-25 17:25:25 +00:00
parent badde0e765
commit 331bc36b60

View File

@ -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"];