Skip to content

Commit 69b093c

Browse files
committed
fixed built tests
1 parent e5af7e2 commit 69b093c

File tree

3 files changed

+550
-248
lines changed

3 files changed

+550
-248
lines changed

adafruit_sgp40/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"""
3232
from time import sleep
3333
from struct import unpack_from
34-
import adafruit_bus_device.i2c_device as i2c_device
34+
from adafruit_bus_device import i2c_device
3535
from adafruit_sgp40.voc_algorithm import VOCAlgorithm
3636

3737
__version__ = "0.0.0-auto.0"
@@ -230,12 +230,13 @@ def measure_raw(self, temperature=25, relative_humidity=50):
230230
return self.raw
231231

232232
def measure_index(self, temperature=25, relative_humidity=50):
233-
""" Measure VOC index after humidity compensation
233+
"""Measure VOC index after humidity compensation
234234
:param float temperature: The temperature in degrees Celsius, defaults
235235
to :const:`25`
236236
:param float relative_humidity: The relative humidity in percentage, defaults
237237
to :const:`50`
238-
:note VOC index can indicate the quality of the air directly. The larger the value, the worse the air quality.
238+
:note VOC index can indicate the quality of the air directly.
239+
The larger the value, the worse the air quality.
239240
:note 0-100,no need to ventilate, purify
240241
:note 100-200,no need to ventilate, purify
241242
:note 200-400,ventilate, purify
@@ -245,9 +246,8 @@ def measure_index(self, temperature=25, relative_humidity=50):
245246
raw = self.measure_raw(temperature, relative_humidity)
246247
if raw < 0:
247248
return -1
248-
else:
249-
vocIndex = self._voc_algorithm.vocalgorithm_process(raw)
250-
return vocIndex
249+
voc_index = self._voc_algorithm.vocalgorithm_process(raw)
250+
return voc_index
251251

252252
def _read_word_from_command(
253253
self,

0 commit comments

Comments
 (0)