From 500c4b9d704dbc60bbb064c4dc1b5b444e5cf0e0 Mon Sep 17 00:00:00 2001 From: "Ryan A. Pavlik" Date: Sat, 23 Jan 2021 21:50:29 -0600 Subject: [PATCH 1/4] Change all "e-CO2" references to CO2: This is a true CO2 sensor. --- README.rst | 4 ++-- adafruit_scd30.py | 12 ++++++------ examples/scd30_simpletest.py | 2 +- examples/scd30_tuning_knobs.py | 2 +- setup.py | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.rst b/README.rst index 97ae64d..823cbf1 100644 --- a/README.rst +++ b/README.rst @@ -17,7 +17,7 @@ Introduction :target: https://github.com/psf/black :alt: Code Style: Black -Helper library for the SCD30 e-CO2 sensor +Helper library for the SCD30 CO2 sensor Dependencies @@ -75,7 +75,7 @@ Usage Example # the values, to ensure current readings. if scd.data_available: print("Data Available!") - print("eCO2:", scd.eCO2, "PPM") + print("CO2:", scd.CO2, "PPM") print("Temperature:", scd.temperature, "degrees C") print("Humidity:", scd.relative_humidity, "%%rH") print("") diff --git a/adafruit_scd30.py b/adafruit_scd30.py index 63bbebc..b6aaf60 100644 --- a/adafruit_scd30.py +++ b/adafruit_scd30.py @@ -5,7 +5,7 @@ `adafruit_scd30` ================================================================================ -Helper library for the SCD30 e-CO2 sensor +Helper library for the SCD30 CO2 sensor * Author(s): Bryan Siepert @@ -50,7 +50,7 @@ class SCD30: - """CircuitPython helper class for using the SCD30 e-CO2 sensor""" + """CircuitPython helper class for using the SCD30 CO2 sensor""" def __init__(self, i2c_bus, ambient_pressure=0, address=SCD30_DEFAULT_ADDR): if ambient_pressure != 0: @@ -71,7 +71,7 @@ def __init__(self, i2c_bus, ambient_pressure=0, address=SCD30_DEFAULT_ADDR): # cached readings self._temperature = None self._relative_humidity = None - self._e_co2 = None + self._co2 = None def reset(self): """Perform a soft reset on the sensor, restoring default values""" @@ -174,13 +174,13 @@ def forced_recalibration_reference(self, reference_value): self._send_command(_CMD_SET_FORCED_RECALIBRATION_FACTOR, reference_value) @property - def eCO2(self): # pylint:disable=invalid-name + def CO2(self): # pylint:disable=invalid-name """Returns the CO2 concentration in PPM (parts per million) **NOTE** Between measurements, the most recent reading will be cached and returned.""" if self.data_available: self._read_data() - return self._e_co2 + return self._co2 @property def temperature(self): @@ -244,7 +244,7 @@ def _read_data(self): if not crcs_good: raise RuntimeError("CRC check failed while reading data") - self._e_co2 = unpack(">f", self._buffer[0:2] + self._buffer[3:5])[0] + self._co2 = unpack(">f", self._buffer[0:2] + self._buffer[3:5])[0] self._temperature = unpack(">f", self._buffer[6:8] + self._buffer[9:11])[0] self._relative_humidity = unpack( ">f", self._buffer[12:14] + self._buffer[15:17] diff --git a/examples/scd30_simpletest.py b/examples/scd30_simpletest.py index 942436c..fac085e 100644 --- a/examples/scd30_simpletest.py +++ b/examples/scd30_simpletest.py @@ -14,7 +14,7 @@ # the values, to ensure current readings. if scd.data_available: print("Data Available!") - print("eCO2:", scd.eCO2, "PPM") + print("CO2:", scd.CO2, "PPM") print("Temperature:", scd.temperature, "degrees C") print("Humidity:", scd.relative_humidity, "%%rH") print("") diff --git a/examples/scd30_tuning_knobs.py b/examples/scd30_tuning_knobs.py index dfc1b7f..c9c4fc6 100644 --- a/examples/scd30_tuning_knobs.py +++ b/examples/scd30_tuning_knobs.py @@ -31,7 +31,7 @@ data = scd.data_available if data: print("Data Available!") - print("eCO2:", scd.eCO2, "PPM") + print("CO2:", scd.CO2, "PPM") print("Temperature:", scd.temperature, "degrees C") print("Humidity::", scd.relative_humidity, "%%rH") print("") diff --git a/setup.py b/setup.py index 3164675..6e2f1a2 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ name="adafruit-circuitpython-scd30", use_scm_version=True, setup_requires=["setuptools_scm"], - description="Helper library for the SCD30 e-CO2 sensor", + description="Helper library for the SCD30 CO2 sensor", long_description=long_description, long_description_content_type="text/x-rst", # The project's main homepage. From 668b4209983134615fc8a35809428fa0d67c6011 Mon Sep 17 00:00:00 2001 From: "Ryan A. Pavlik" Date: Sat, 23 Jan 2021 21:51:41 -0600 Subject: [PATCH 2/4] Fix documentation typos --- adafruit_scd30.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/adafruit_scd30.py b/adafruit_scd30.py index b6aaf60..b2fce89 100644 --- a/adafruit_scd30.py +++ b/adafruit_scd30.py @@ -82,7 +82,7 @@ def reset(self): def measurement_interval(self): """Sets the interval between readings in seconds. The interval value must be from 2-1800 - **NOTE** This value will be saved and will not be reset on boot or by callint `reset`.""" + **NOTE** This value will be saved and will not be reset on boot or by calling `reset`.""" return self._read_register(_CMD_SET_MEASUREMENT_INTERVAL) @@ -101,7 +101,7 @@ def self_calibration_enabled(self): **NOTE**: Enabling self calibration will override any values set by specifying a `forced_recalibration_reference` - **NOTE** This setting will be saved and will not be reset on boot or by callint `reset`.""" + **NOTE** This setting will be saved and will not be reset on boot or by calling `reset`.""" return self._read_register(_CMD_AUTOMATIC_SELF_CALIBRATION) == 1 @@ -133,7 +133,7 @@ def altitude(self): this value adjusts the CO2 measurement calculations to account for the air pressure's effect on readings. - **NOTE** This value will be stored and will not be reset on boot or by callint `reset`.""" + **NOTE** This value will be stored and will not be reset on boot or by calling `reset`.""" return self._read_register(_CMD_SET_ALTITUDE_COMPENSATION) @altitude.setter @@ -143,10 +143,10 @@ def altitude(self, altitude): @property def temperature_offset(self): """Specifies the offset to be added to the reported measurements to account for a bias in - the measured signal. Value is in degrees Celcius with a resolution of 0.01 degrees and a + the measured signal. Value is in degrees Celsius with a resolution of 0.01 degrees and a maximum value of 655.35 C - **NOTE** This value will be saved and will not be reset on boot or by callint `reset`.""" + **NOTE** This value will be saved and will not be reset on boot or by calling `reset`.""" raw_offset = self._read_register(_CMD_SET_TEMPERATURE_OFFSET) return raw_offset / 100.0 From c16f2b1f89b2e22f4e9d0e0bc790cb662e79cbd1 Mon Sep 17 00:00:00 2001 From: "Ryan A. Pavlik" Date: Sat, 23 Jan 2021 21:52:08 -0600 Subject: [PATCH 3/4] fix product link --- adafruit_scd30.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_scd30.py b/adafruit_scd30.py index b2fce89..95fc9fe 100644 --- a/adafruit_scd30.py +++ b/adafruit_scd30.py @@ -15,7 +15,7 @@ **Hardware:** -* `Adafruit SCD30 Breakout `_ +* `Adafruit SCD30 Breakout `_ **Software and Dependencies:** From d8f0f3935ff28ee03148a9ae9b0fe4e03b5c3e36 Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Tue, 26 Jan 2021 10:52:16 -0600 Subject: [PATCH 4/4] Fix pre-commit issue. --- docs/examples.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/examples.rst b/docs/examples.rst index 884594b..5cff903 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -14,4 +14,4 @@ Experiment with different tuning parameters and settings .. literalinclude:: ../examples/scd30_tuning_knobs.py :caption: examples/scd30_tuning_knobs.py - :linenos: \ No newline at end of file + :linenos: