Skip to content

sphinx doc improvements #24

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 10 commits into from
Dec 22, 2020
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Contributing
============

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

Documentation
Expand Down
19 changes: 4 additions & 15 deletions adafruit_bluefruit_connect/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,13 @@
`adafruit_bluefruit_connect`
============================

This module helps you to communicate with the Adafruit Bluefruit Connect app or use its protocols.
This module helps you to communicate with the `Adafruit Bluefruit Connect App
<https://learn.adafruit.com/bluefruit-le-connect>`_ or use its protocols with
boards that run `Adafruit CircuitPython firmware
<https://circuitpython.org/downloads>`_.

* Author(s): Dan Halbert for Adafruit Industries

Implementation Notes
--------------------

**Hardware:**

Adafruit Feather nRF52840 Express <https://www.adafruit.com/product/4062>

**Software and Dependencies:**

* Adafruit Bluefruit LE Connect App
https://learn.adafruit.com/bluefruit-le-connect-for-ios (also available for Android)
* Adafruit CircuitPython firmware for the supported boards:
https://github.com/adafruit/circuitpython/releases

"""

# imports
Expand Down
5 changes: 2 additions & 3 deletions adafruit_bluefruit_connect/_xyz_packet.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ class _XYZPacket(Packet):
# _TYPE_HEADER is set by each concrete subclass.

def __init__(self, x, y, z):
"""Construct an _XYZPacket subclass object
from the given x, y, and z float values, and type character.
"""
# Construct an _XYZPacket subclass object
# from the given x, y, and z float values, and type character.
self._x = x
self._y = y
self._z = z
Expand Down
8 changes: 5 additions & 3 deletions adafruit_bluefruit_connect/button_packet.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ def __init__(self, button, pressed):
"""Construct a ButtonPacket from a button name and the button's state.

:param str button: a single character denoting the button
:param bool pressed: ``True`` if button is pressed; ``False`` if it is release.
:param bool pressed: ``True`` if button is pressed; ``False`` if it is
released.
"""
# This check will catch wrong length and also non-sequence args (like an int).
try:
Expand Down Expand Up @@ -100,12 +101,13 @@ def to_bytes(self):

@property
def button(self):
"""A single character string (not bytes) specifying the button."""
"""A single character string (not bytes) specifying the button that
the user pressed or released."""
return self._button

@property
def pressed(self):
"""True if button is pressed."""
"""``True`` if button is pressed, or ``False`` if it is released."""
return self._pressed


Expand Down
9 changes: 5 additions & 4 deletions adafruit_bluefruit_connect/color_packet.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ class ColorPacket(Packet):
_TYPE_HEADER = b"!C"

def __init__(self, color):
"""Construct a ColorPacket from a 3-tuple of RGB values,
or from an int color value 0xRRGGBB.
"""Construct a ColorPacket from a 3-element :class:`tuple` of RGB
values, or from an int color value 0xRRGGBB.

:param tuple/int color: an RGB tuple ``(red, green, blue)``
:param tuple/int color: an RGB :class:`tuple` ``(red, green, blue)``
or an int color value ``0xRRGGBB``
"""
if isinstance(color, int):
Expand Down Expand Up @@ -75,7 +75,8 @@ def to_bytes(self):

@property
def color(self):
"""A tuple(red, green blue)."""
"""A :class:`tuple` ``(red, green blue)`` representing the color the
user chose in the BlueFruit Connect app."""
return self._color


Expand Down
4 changes: 2 additions & 2 deletions adafruit_bluefruit_connect/packet.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class Packet:
- '!' - The first byte is always an exclamation point.
- *type* - A single byte designating the type of packet: b'A', b'B', etc.
- *data ...* - Multiple bytes of data, varying by packet type.
- *checksum* - A single byte checksum, computed by adding up all the data bytes and
inverting the sum.
- *checksum* - A single byte checksum, computed by adding up all the data
bytes and inverting the sum.

This is an abstract class.
"""
Expand Down
3 changes: 2 additions & 1 deletion adafruit_bluefruit_connect/quaternion_packet.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@


class QuaternionPacket(_XYZPacket):
"""A packet of x, y, z float values. Used for several different Bluefruit controller packets."""
"""Device Motion data to describe device attitude. This data is derived
from Accelerometer, Gyro, and Magnetometer readings."""

# Use _XYZPacket to handle x, y, z, and add w.

Expand Down
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
"CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None),
}

autoclass_content = "both"

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Table of Contents
.. toctree::
:caption: Other Links

Download <https://github.com/adafruit/adafruit_CircuitPython_ble/releases/latest>
Download <https://github.com/adafruit/Adafruit_CircuitPython_BluefruitConnect/releases/latest>
CircuitPython Reference Documentation <https://circuitpython.readthedocs.io>
CircuitPython Support Forum <https://forums.adafruit.com/viewforum.php?f=60>
Discord Chat <https://adafru.it/discord>
Expand Down