From cbf733ebba76f8bc562b09df65540644858a8965 Mon Sep 17 00:00:00 2001 From: gphi Date: Sat, 18 Jul 2020 12:07:52 +0200 Subject: [PATCH 1/2] implemented the reading of raw sensor signals h2 and ethanol --- adafruit_sgp30.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/adafruit_sgp30.py b/adafruit_sgp30.py index cb92f3b..1c2f17f 100755 --- a/adafruit_sgp30.py +++ b/adafruit_sgp30.py @@ -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 @@ -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 From 59730ee79b1302eb6bfdbc43e230726a32e665c8 Mon Sep 17 00:00:00 2001 From: gphi Date: Sat, 18 Jul 2020 12:09:39 +0200 Subject: [PATCH 2/2] added h2 and ethanol to the keywords --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 45bcd11..51413a4 100644 --- a/setup.py +++ b/setup.py @@ -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"],