Skip to content

Commit fe85741

Browse files
authored
Merge pull request #17 from dherrada/master
changing eCO2 and TVOC to eco2 and tvoc respectively
2 parents cd9691a + 5cb2f4f commit fe85741

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

adafruit_ccs811.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ def __init__(self, i2c_bus, address=0x5A):
122122
#default to read every second
123123
self.drive_mode = DRIVE_MODE_1SEC
124124

125-
self._eCO2 = None # pylint: disable=invalid-name
126-
self._TVOC = None # pylint: disable=invalid-name
125+
self._eco2 = None # pylint: disable=invalid-name
126+
self._tvoc = None # pylint: disable=invalid-name
127127

128128
@property
129129
def error_code(self):
@@ -143,22 +143,22 @@ def _update_data(self):
143143
i2c.write(buf, end=1, stop=False)
144144
i2c.readinto(buf, start=1)
145145

146-
self._eCO2 = (buf[1] << 8) | (buf[2])
147-
self._TVOC = (buf[3] << 8) | (buf[4])
146+
self._eco2 = (buf[1] << 8) | (buf[2])
147+
self._tvoc = (buf[3] << 8) | (buf[4])
148148

149149
if self.error:
150150
raise RuntimeError("Error:" + str(self.error_code))
151151

152152
@property
153-
def TVOC(self): # pylint: disable=invalid-name
153+
def tvoc(self): # pylint: disable=invalid-name
154154
"""Total Volatile Organic Compound in parts per billion."""
155155
self._update_data()
156-
return self._TVOC
156+
return self._tvoc
157157

158158
@property
159-
def eCO2(self): # pylint: disable=invalid-name
159+
def eco2(self): # pylint: disable=invalid-name
160160
"""Equivalent Carbon Dioxide in parts per million. Clipped to 400 to 8192ppm."""
161-
return self._eCO2
161+
return self._eco2
162162

163163
@property
164164
def temperature(self):

examples/ccs811_simpletest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
ccs.temp_offset = temp - 25.0
1717

1818
while True:
19-
print("CO2: ", ccs.eCO2, " TVOC:", ccs.TVOC, " temp:", ccs.temperature)
19+
print("CO2: ", ccs.eco2, " TVOC:", ccs.tvoc, " temp:", ccs.temperature)
2020
time.sleep(.5)

0 commit comments

Comments
 (0)