Skip to content

Commit 0f2fe92

Browse files
committed
Constrain lux values within valid limits
Issue #8
1 parent de63531 commit 0f2fe92

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ SunPositionAccessory.prototype.updatePosition = function() {
8282
var times = suncalc.getTimes(now, this.location.lat, this.location.long);
8383

8484
// Arbitrary lux values for times.
85-
var lux = 0;
85+
var lux = 0.0001;
8686
if (now >= times.sunrise && now <= times.sunriseEnd) {
8787
lux = 400;
8888
} else if (now > times.sunriseEnd && now <= times.goldenHourEnd) {
@@ -96,7 +96,7 @@ SunPositionAccessory.prototype.updatePosition = function() {
9696
} else if (now >= times.nightEnd && now < times.sunrise) {
9797
lux = 40;
9898
} else if (now > times.goldenHourEnd && now < times.goldenHour) {
99-
lux = 120000;
99+
lux = 100000;
100100
}
101101

102102
this.service.setCharacteristic(Characteristic.CurrentAmbientLightLevel, lux);

0 commit comments

Comments
 (0)