Skip to content

Commit 5374640

Browse files
authored
Merge pull request #5 from rpavlik/eco2-fix
eCO2 -> CO2
2 parents 06b4da0 + d8f0f39 commit 5374640

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Introduction
1717
:target: https://github.com/psf/black
1818
:alt: Code Style: Black
1919

20-
Helper library for the SCD30 e-CO2 sensor
20+
Helper library for the SCD30 CO2 sensor
2121

2222

2323
Dependencies
@@ -75,7 +75,7 @@ Usage Example
7575
# the values, to ensure current readings.
7676
if scd.data_available:
7777
print("Data Available!")
78-
print("eCO2:", scd.eCO2, "PPM")
78+
print("CO2:", scd.CO2, "PPM")
7979
print("Temperature:", scd.temperature, "degrees C")
8080
print("Humidity:", scd.relative_humidity, "%%rH")
8181
print("")

adafruit_scd30.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
`adafruit_scd30`
66
================================================================================
77
8-
Helper library for the SCD30 e-CO2 sensor
8+
Helper library for the SCD30 CO2 sensor
99
1010
1111
* Author(s): Bryan Siepert
@@ -15,7 +15,7 @@
1515
1616
**Hardware:**
1717
18-
* `Adafruit SCD30 Breakout <https://www.adafruit.com/product/48xx>`_
18+
* `Adafruit SCD30 Breakout <https://www.adafruit.com/product/4867>`_
1919
2020
**Software and Dependencies:**
2121
@@ -50,7 +50,7 @@
5050

5151

5252
class SCD30:
53-
"""CircuitPython helper class for using the SCD30 e-CO2 sensor"""
53+
"""CircuitPython helper class for using the SCD30 CO2 sensor"""
5454

5555
def __init__(self, i2c_bus, ambient_pressure=0, address=SCD30_DEFAULT_ADDR):
5656
if ambient_pressure != 0:
@@ -71,7 +71,7 @@ def __init__(self, i2c_bus, ambient_pressure=0, address=SCD30_DEFAULT_ADDR):
7171
# cached readings
7272
self._temperature = None
7373
self._relative_humidity = None
74-
self._e_co2 = None
74+
self._co2 = None
7575

7676
def reset(self):
7777
"""Perform a soft reset on the sensor, restoring default values"""
@@ -82,7 +82,7 @@ def reset(self):
8282
def measurement_interval(self):
8383
"""Sets the interval between readings in seconds. The interval value must be from 2-1800
8484
85-
**NOTE** This value will be saved and will not be reset on boot or by callint `reset`."""
85+
**NOTE** This value will be saved and will not be reset on boot or by calling `reset`."""
8686

8787
return self._read_register(_CMD_SET_MEASUREMENT_INTERVAL)
8888

@@ -101,7 +101,7 @@ def self_calibration_enabled(self):
101101
**NOTE**: Enabling self calibration will override any values set by specifying a
102102
`forced_recalibration_reference`
103103
104-
**NOTE** This setting will be saved and will not be reset on boot or by callint `reset`."""
104+
**NOTE** This setting will be saved and will not be reset on boot or by calling `reset`."""
105105

106106
return self._read_register(_CMD_AUTOMATIC_SELF_CALIBRATION) == 1
107107

@@ -133,7 +133,7 @@ def altitude(self):
133133
this value adjusts the CO2 measurement calculations to account for the air pressure's effect
134134
on readings.
135135
136-
**NOTE** This value will be stored and will not be reset on boot or by callint `reset`."""
136+
**NOTE** This value will be stored and will not be reset on boot or by calling `reset`."""
137137
return self._read_register(_CMD_SET_ALTITUDE_COMPENSATION)
138138

139139
@altitude.setter
@@ -143,10 +143,10 @@ def altitude(self, altitude):
143143
@property
144144
def temperature_offset(self):
145145
"""Specifies the offset to be added to the reported measurements to account for a bias in
146-
the measured signal. Value is in degrees Celcius with a resolution of 0.01 degrees and a
146+
the measured signal. Value is in degrees Celsius with a resolution of 0.01 degrees and a
147147
maximum value of 655.35 C
148148
149-
**NOTE** This value will be saved and will not be reset on boot or by callint `reset`."""
149+
**NOTE** This value will be saved and will not be reset on boot or by calling `reset`."""
150150

151151
raw_offset = self._read_register(_CMD_SET_TEMPERATURE_OFFSET)
152152
return raw_offset / 100.0
@@ -174,13 +174,13 @@ def forced_recalibration_reference(self, reference_value):
174174
self._send_command(_CMD_SET_FORCED_RECALIBRATION_FACTOR, reference_value)
175175

176176
@property
177-
def eCO2(self): # pylint:disable=invalid-name
177+
def CO2(self): # pylint:disable=invalid-name
178178
"""Returns the CO2 concentration in PPM (parts per million)
179179
180180
**NOTE** Between measurements, the most recent reading will be cached and returned."""
181181
if self.data_available:
182182
self._read_data()
183-
return self._e_co2
183+
return self._co2
184184

185185
@property
186186
def temperature(self):
@@ -244,7 +244,7 @@ def _read_data(self):
244244
if not crcs_good:
245245
raise RuntimeError("CRC check failed while reading data")
246246

247-
self._e_co2 = unpack(">f", self._buffer[0:2] + self._buffer[3:5])[0]
247+
self._co2 = unpack(">f", self._buffer[0:2] + self._buffer[3:5])[0]
248248
self._temperature = unpack(">f", self._buffer[6:8] + self._buffer[9:11])[0]
249249
self._relative_humidity = unpack(
250250
">f", self._buffer[12:14] + self._buffer[15:17]

docs/examples.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ Experiment with different tuning parameters and settings
1414

1515
.. literalinclude:: ../examples/scd30_tuning_knobs.py
1616
:caption: examples/scd30_tuning_knobs.py
17-
:linenos:
17+
:linenos:

examples/scd30_simpletest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# the values, to ensure current readings.
1515
if scd.data_available:
1616
print("Data Available!")
17-
print("eCO2:", scd.eCO2, "PPM")
17+
print("CO2:", scd.CO2, "PPM")
1818
print("Temperature:", scd.temperature, "degrees C")
1919
print("Humidity:", scd.relative_humidity, "%%rH")
2020
print("")

examples/scd30_tuning_knobs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
data = scd.data_available
3232
if data:
3333
print("Data Available!")
34-
print("eCO2:", scd.eCO2, "PPM")
34+
print("CO2:", scd.CO2, "PPM")
3535
print("Temperature:", scd.temperature, "degrees C")
3636
print("Humidity::", scd.relative_humidity, "%%rH")
3737
print("")

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
name="adafruit-circuitpython-scd30",
2727
use_scm_version=True,
2828
setup_requires=["setuptools_scm"],
29-
description="Helper library for the SCD30 e-CO2 sensor",
29+
description="Helper library for the SCD30 CO2 sensor",
3030
long_description=long_description,
3131
long_description_content_type="text/x-rst",
3232
# The project's main homepage.

0 commit comments

Comments
 (0)