diff --git a/adafruit_ccs811.py b/adafruit_ccs811.py index 7bc9477..c2489f6 100644 --- a/adafruit_ccs811.py +++ b/adafruit_ccs811.py @@ -122,8 +122,8 @@ def __init__(self, i2c_bus, address=0x5A): #default to read every second self.drive_mode = DRIVE_MODE_1SEC - self._eCO2 = None # pylint: disable=invalid-name - self._TVOC = None # pylint: disable=invalid-name + self._eco2 = None # pylint: disable=invalid-name + self._tvoc = None # pylint: disable=invalid-name @property def error_code(self): @@ -143,22 +143,22 @@ def _update_data(self): i2c.write(buf, end=1, stop=False) i2c.readinto(buf, start=1) - self._eCO2 = (buf[1] << 8) | (buf[2]) - self._TVOC = (buf[3] << 8) | (buf[4]) + self._eco2 = (buf[1] << 8) | (buf[2]) + self._tvoc = (buf[3] << 8) | (buf[4]) if self.error: raise RuntimeError("Error:" + str(self.error_code)) @property - def TVOC(self): # pylint: disable=invalid-name + def tvoc(self): # pylint: disable=invalid-name """Total Volatile Organic Compound in parts per billion.""" self._update_data() - return self._TVOC + return self._tvoc @property - def eCO2(self): # pylint: disable=invalid-name + def eco2(self): # pylint: disable=invalid-name """Equivalent Carbon Dioxide in parts per million. Clipped to 400 to 8192ppm.""" - return self._eCO2 + return self._eco2 @property def temperature(self): diff --git a/examples/ccs811_simpletest.py b/examples/ccs811_simpletest.py index c58968f..df9740e 100644 --- a/examples/ccs811_simpletest.py +++ b/examples/ccs811_simpletest.py @@ -16,5 +16,5 @@ ccs.temp_offset = temp - 25.0 while True: - print("CO2: ", ccs.eCO2, " TVOC:", ccs.TVOC, " temp:", ccs.temperature) + print("CO2: ", ccs.eco2, " TVOC:", ccs.tvoc, " temp:", ccs.temperature) time.sleep(.5)