31
31
"""
32
32
from time import sleep
33
33
from struct import unpack_from
34
- import adafruit_bus_device . i2c_device as i2c_device
34
+ from adafruit_bus_device import i2c_device
35
35
from adafruit_sgp40 .voc_algorithm import VOCAlgorithm
36
36
37
37
__version__ = "0.0.0-auto.0"
@@ -230,12 +230,13 @@ def measure_raw(self, temperature=25, relative_humidity=50):
230
230
return self .raw
231
231
232
232
def measure_index (self , temperature = 25 , relative_humidity = 50 ):
233
- """ Measure VOC index after humidity compensation
233
+ """Measure VOC index after humidity compensation
234
234
:param float temperature: The temperature in degrees Celsius, defaults
235
235
to :const:`25`
236
236
:param float relative_humidity: The relative humidity in percentage, defaults
237
237
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.
239
240
:note 0-100,no need to ventilate, purify
240
241
:note 100-200,no need to ventilate, purify
241
242
:note 200-400,ventilate, purify
@@ -245,9 +246,8 @@ def measure_index(self, temperature=25, relative_humidity=50):
245
246
raw = self .measure_raw (temperature , relative_humidity )
246
247
if raw < 0 :
247
248
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
251
251
252
252
def _read_word_from_command (
253
253
self ,
0 commit comments