From 70898f506996a4c0a023c9a7df240f9274fc4011 Mon Sep 17 00:00:00 2001 From: Solveigh Date: Sat, 23 Nov 2024 09:36:53 +0100 Subject: [PATCH] added new method get_air_quality_values --- library/sgp30/__init__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/library/sgp30/__init__.py b/library/sgp30/__init__.py index 8937dc5..b2d1ca7 100644 --- a/library/sgp30/__init__.py +++ b/library/sgp30/__init__.py @@ -162,6 +162,17 @@ def get_air_quality(self): eco2, tvoc = self.command('measure_air_quality') return SGP30Reading(eco2, tvoc) + def get_air_quality_values(self): + """Get an air quality measurement. + + Returns the measured equivalent_co2 and total_voc directly. + + This should be called at 1s intervals to ensure the dynamic baseline compensation on the SGP30 operates correctly. + + """ + eco2, tvoc = self.command('measure_air_quality') + return eco2, tvoc + def get_baseline(self): """Get the current baseline setting.