1
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-05-07 22:29:19 +00:00

MD improve nextTr calculation

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@5774 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2014-05-07 07:02:10 +00:00
parent 863e673b75
commit 48df02f876

View File

@ -1697,13 +1697,12 @@ sub CUL_HM_Parse($$) {#########################################################
push @evtEt,[$shash,1,"battery:". (($err&0x80)?"low" :"ok" )];
}
elsif($mTp eq "41") {#01 is channel
my($cnt,$bright,$nextTr) = (hex($mI[1]),hex($mI[2]),
((@mI >2)?(hex($mI[3])>>4):0));
my @nextVal = ("0x0","0x1","0x2","0x3","15" ,"30" ,"60" ,"120",
"240","0x9","0xa","0xb","0xc","0xd","0xe","0xf");
my($cnt,$bright) = (hex($mI[1]),hex($mI[2]));
my $nextTr = (@mI >2)? (int((1<<((hex($mI[3])>>4)-1))/1.1)."s")
: "-";
push @evtEt,[$shash,1,"state:motion"];
push @evtEt,[$shash,1,"motion:on$target"];
push @evtEt,[$shash,1,"motionCount:$cnt"."_next:$nextTr"."-$nextVal[$nextTr]"];
push @evtEt,[$shash,1,"motionCount:$cnt"."_next:$nextTr"];
push @evtEt,[$shash,1,"brightness:$bright"];
}
elsif($mTp eq "70" && $p =~ m/^7F(..)(.*)/) {