Skip to content

set_iaq_humidity #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions adafruit_sgp30.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ def set_iaq_baseline(self, eCO2, TVOC): # pylint: disable=invalid-name
buffer += arr
self._run_profile(["iaq_set_baseline", [0x20, 0x1e] + buffer, 0, 0.01])

def set_iaq_humidity(self, gramsPM3): # pylint: disable=invalid-name
"""Set the humidity in g/m3 for eCO2 and TVOC compensation algorithm"""
tmp = int(gramsPM3 * 256)
buffer = []
for value in [tmp]:
arr = [value >> 8, value & 0xFF]
arr.append(self._generate_crc(arr))
buffer += arr
self._run_profile(["iaq_set_humidity", [0x20, 0x61] + buffer, 0, 0.01])

# Low level command functions

Expand Down