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
This commit is contained in:
martinp876 2017-07-02 13:19:36 +00:00
parent 13a8453114
commit c3c828b8f0

View File

@ -2843,7 +2843,7 @@ sub CUL_HM_Parse($$) {#########################################################
$stAck = '01'.$dChNo.(($stT eq "ON")?"C8":"00")."00" $stAck = '01'.$dChNo.(($stT eq "ON")?"C8":"00")."00"
} }
if ($mh{mFlgH} & 0x20){ if ((($mh{mFlgH} & 0x24) == 0x20)){
$longPress .= "_Release"; $longPress .= "_Release";
$dChHash->{helper}{trgLgRpt}=0; $dChHash->{helper}{trgLgRpt}=0;
push @ack,$mh{shash},$mh{mNo}."8002".$mh{dst}.$mh{src}.$stAck; 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}{BNO} = $cnt;
$mhp->{cHash}{helper}{BNOCNT} = 0; # message counter reset $mhp->{cHash}{helper}{BNOCNT} = 0; # message counter reset
} }
$mhp->{cHash}{helper}{BNOCNT} += 1; if (($mhp->{mFlgH} & 0x24) == 0x20 && ($long eq "long")){ # release long press
#$state .= ($mhp->{mFlgH} & 0x20 ? "Release" : "")." $mhp->{cHash}{helper}{BNOCNT}_$cnt" # not sufficient $state .= "Release";
$state .= ((($mhp->{mFlgH} & 0x24) == 0x20) ? "Release" : "")." $mhp->{cHash}{helper}{BNOCNT}_$cnt" }
if($long eq "long"); 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,"trigger:".(ucfirst($long))."_$cnt"];
push @evtEt,[$mhp->{cHash},1,"state:".$state." (to $mhp->{dstN})"] if ($mhp->{devH} ne $mhp->{cHash}); push @evtEt,[$mhp->{cHash},1,"state:".$state." (to $mhp->{dstN})"] if ($mhp->{devH} ne $mhp->{cHash});