Skip to content

Commit beabdd6

Browse files
committed
The value when closed was too high when light was present for percentage
1 parent 2c197fa commit beabdd6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Source/LightEvidenceSource.m

+3-2
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,12 @@ - (double)levelFromRawLeft:(uint64_t)left andRight:(uint64_t)right {
8686
// COMMENTS(jbeker) below is the observed max value on a 15" Late 2013 Macbook Pro
8787
// This value is ridiculous and results in a much smaller
8888
// useful value range.
89-
const double kMaxLightValue = 4294967295.0;
89+
const double kClosedLightValue = 4294967295.0;
90+
const double kMaxLightValue = 67092480.0;;
9091

9192
const double avg = (left + right) / 2; // determine average value from the two sensors
9293

93-
if (avg == kMaxLightValue) {
94+
if (avg == kClosedLightValue) {
9495
return 0; // COMMENTS(jbeker) on a 15" Late 2013 Macbook Pro it returns max value when the laptop is shut
9596
} else {
9697
return (avg / kMaxLightValue); // normalize

0 commit comments

Comments
 (0)