diff --git a/adafruit_tsl2561.py b/adafruit_tsl2561.py index f1a2a0b..ff4bfb9 100644 --- a/adafruit_tsl2561.py +++ b/adafruit_tsl2561.py @@ -107,7 +107,7 @@ def enabled(self, enable): @property def lux(self): - """The computed lux value.""" + """The computed lux value or None when value is not computable.""" return self._compute_lux() @property @@ -177,7 +177,7 @@ def _compute_lux(self): elif ratio <= 1.30: lux = 0.00146 * ch0 - 0.00112 * ch1 else: - lux = 0 + lux = 0. # Pretty sure the floating point math formula on pg. 23 of datasheet # is based on 16x gain and 402ms integration time. Need to scale # result for other settings.