Skip to content
Merged
Show file tree
Hide file tree
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
17 changes: 17 additions & 0 deletions adafruit_sgp30.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,18 @@ def baseline_eCO2(self):
"""Carbon Dioxide Equivalent baseline value"""
return self.get_iaq_baseline()[0]

@property
# pylint: disable=invalid-name
def Ethanol(self):
"""Ethanol Raw Signal in ticks"""
return self.raw_measure()[1]

@property
# pylint: disable=invalid-name
def H2(self):
"""H2 Raw Signal in ticks"""
return self.raw_measure()[0]

def iaq_init(self):
"""Initialize the IAQ algorithm"""
# name, command, signals, delay
Expand All @@ -110,6 +122,11 @@ def iaq_measure(self):
# name, command, signals, delay
return self._run_profile(["iaq_measure", [0x20, 0x08], 2, 0.05])

def raw_measure(self):
"""Measure H2 and Ethanol (Raw Signals)"""
# name, command, signals, delay
return self._run_profile(["raw_measure", [0x20, 0x50], 2, 0.025])

def get_iaq_baseline(self):
"""Retreive the IAQ algorithm baseline for eCO2 and TVOC"""
# name, command, signals, delay
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"Programming Language :: Python :: 3.5",
],
# What does your project relate to?
keywords="adafruit sensiron sgp30 gas sensor eco2 tvoc i2c hardware micropython circuitpython",
keywords="adafruit sensiron sgp30 gas sensor eco2 tvoc h2 ethanol i2c hardware micropython circuitpython",
# You can just specify the packages manually here if your project is
# simple. Or you can use find_packages().
py_modules=["adafruit_sgp30"],
Expand Down