Skip to content
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

Show info about resolution and mode in docs #11

Merged
merged 2 commits into from
Nov 6, 2024
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
8 changes: 6 additions & 2 deletions adafruit_bh1750.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def __set__(self, obj: "BH1750", value: int) -> None:


class Mode(CV):
"""Options for ``mode``"""
"""Options for `mode`. Valid values are ``SHUTDOWN``, ``CONTINUOUS``, and ``ONE_SHOT``"""

pass # pylint: disable=unnecessary-pass

Expand All @@ -138,7 +138,7 @@ class Mode(CV):


class Resolution(CV):
"""Options for ``resolution``"""
"""Options for `resolution` Valid values are ``LOW``, ``MID``, and ``HIGH``"""

pass # pylint: disable=unnecessary-pass

Expand Down Expand Up @@ -186,7 +186,11 @@ class BH1750: # pylint:disable=too-many-instance-attributes
"""

mode = RWBitfields(2, 4)
"""The capture mode for the sensor. See `Mode` for valid values."""

resolution = RWBitfields(2, 0)
"""The resolution of the sensor. See `Resolution` for valid values."""
""""""

def __init__(self, i2c: I2C, address: int = _BH1750_DEFAULT_ADDRESS) -> None:
self.i2c_device = i2c_device.I2CDevice(i2c, address)
Expand Down
2 changes: 1 addition & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

.. automodule:: adafruit_bh1750
:members:
:exclude-members: CV, Resolution, Mode, RWBitfields
:exclude-members: CV, RWBitfields