Skip to content

Renaming driver/class to match product/repo name. #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 7, 2018
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
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ install:
- pip install pylint circuitpython-build-tools Sphinx sphinx-rtd-theme
- pip install --force-reinstall pylint==1.9.2
script:
- pylint adafruit_sht31.py
- pylint adafruit_sht31d.py
- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace
examples/*.py)
- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-sht31 --library_location
- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-sht31d --library_location
.
- cd docs && sphinx-build -E -W -b html . _build/html && cd ..
10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ You must import the library to use it:

.. code:: python

import adafruit_sht31
import adafruit_sht31d

This driver takes an instantiated and active I2C object (from the `busio` or
the `bitbangio` library) as an argument to its constructor. The way to create
Expand All @@ -53,7 +53,7 @@ the sensor object:

.. code:: python

sensor = adafruit_sht31.SHT31(i2c)
sensor = adafruit_sht31d.SHT31D(i2c)


And then you can start measuring the temperature and humidity:
Expand All @@ -67,7 +67,7 @@ Contributing
============

Contributions are welcome! Please read our `Code of Conduct
<https://github.com/adafruit/Adafruit_CircuitPython_sht31/blob/master/CODE_OF_CONDUCT.md>`_
<https://github.com/adafruit/Adafruit_CircuitPython_SHT31D/blob/master/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.

Building locally
Expand All @@ -92,7 +92,7 @@ Then run the build:

.. code-block:: shell

circuitpython-build-bundles --filename_prefix adafruit-circuitpython-sht31 --library_location .
circuitpython-build-bundles --filename_prefix adafruit-circuitpython-sht31d --library_location .

Sphinx documentation
-----------------------
Expand All @@ -115,4 +115,4 @@ Now, once you have the virtual environment activated:

This will output the documentation to ``docs/_build/html``. Open the index.html in your browser to
view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to
locally verify it will pass.
locally verify it will pass.
8 changes: 4 additions & 4 deletions adafruit_sht31.py → adafruit_sht31d.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
"""
`adafruit_sht31`
`adafruit_sht31d`
====================================================

This is a CircuitPython driver for the SHT31-D temperature and humidity sensor.
Expand Down Expand Up @@ -50,11 +50,11 @@

import time

from adafruit_bus_device.i2c_device import I2CDevice
from micropython import const
from adafruit_bus_device.i2c_device import I2CDevice

__version__ = "0.0.0-auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_sht31.git"
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_SHT31D.git"


SHT31_DEFAULT_ADDR = const(0x44)
Expand Down Expand Up @@ -84,7 +84,7 @@ def _crc(data):
return crc


class SHT31:
class SHT31D:
"""
A driver for the SHT31-D temperature and humidity sensor.

Expand Down
2 changes: 1 addition & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

.. If you created a package, create one automodule per module in the package.

.. automodule:: adafruit_sht31
.. automodule:: adafruit_sht31d
:members:
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
master_doc = 'index'

# General information about the project.
project = u'Adafruit sht31 Library'
project = u'Adafruit SHT31D Library'
copyright = u'2017 Jerry Needell'
author = u'Jerry Needell'

Expand Down
4 changes: 2 additions & 2 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ Simple test

Ensure your device works with this simple test.

.. literalinclude:: ../examples/sht31_simpletest.py
:caption: examples/sht31_simpletest.py
.. literalinclude:: ../examples/sht31d_simpletest.py
:caption: examples/sht31d_simpletest.py
:linenos:
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import time
import board
import busio
import adafruit_sht31
import adafruit_sht31d

# Create library object using our Bus I2C port
i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_sht31.SHT31(i2c)
sensor = adafruit_sht31d.SHT31D(i2c)

loopcount = 0
while True:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@

# You can just specify the packages manually here if your project is
# simple. Or you can use find_packages().
py_modules=['adafruit_sht31'],
py_modules=['adafruit_sht31d'],
)