Skip to content

Commit baa3621

Browse files
authored
Update adafruit_sgp30.py
indicate units
1 parent 532f84b commit baa3621

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

adafruit_sgp30.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@ def set_iaq_baseline(self, eCO2, TVOC): # pylint: disable=invalid-name
130130
buffer += arr
131131
self._run_profile(["iaq_set_baseline", [0x20, 0x1e] + buffer, 0, 0.01])
132132

133-
def set_iaq_humidity(self, rh): # pylint: disable=invalid-name
134-
"""Set the humidity for eCO2 and TVOC compensation algorithm"""
135-
rh = int(rh * 256)
133+
def set_iaq_humidity(self, gramsPM3): # pylint: disable=invalid-name
134+
"""Set the humidity in g/m3 for eCO2 and TVOC compensation algorithm"""
135+
tmp = int(gramsPM3 * 256)
136136
buffer = []
137-
for value in [rh]:
137+
for value in [tmp]:
138138
arr = [value >> 8, value & 0xFF]
139139
arr.append(self._generate_crc(arr))
140140
buffer += arr

0 commit comments

Comments
 (0)