Skip to content

Commit 40dc452

Browse files
authored
Merge pull request #20 from adafruit/patch-fix
Linted
2 parents 669c6d8 + f108c4e commit 40dc452

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

adafruit_vl6180x.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"""
2828
from micropython import const
2929

30-
import adafruit_bus_device.i2c_device as i2c_device
30+
from adafruit_bus_device import i2c_device
3131

3232

3333
__version__ = "0.0.0-auto.0"
@@ -129,8 +129,7 @@ def read_lux(self, gain):
129129
self._write_8(_VL6180X_REG_SYSALS_INTEGRATION_PERIOD_HI, 0)
130130
self._write_8(_VL6180X_REG_SYSALS_INTEGRATION_PERIOD_LO, 100)
131131
# analog gain
132-
if gain > ALS_GAIN_40:
133-
gain = ALS_GAIN_40
132+
gain = min(gain, ALS_GAIN_40)
134133
self._write_8(_VL6180X_REG_SYSALS_ANALOGUE_GAIN, 0x40 | gain)
135134
# start ALS
136135
self._write_8(_VL6180X_REG_SYSALS_START, 0x1)

0 commit comments

Comments
 (0)