Skip to content

Commit

Permalink
docs fixes and include some things from super class
Browse files Browse the repository at this point in the history
  • Loading branch information
FoamyGuy committed Jan 6, 2025
1 parent bdba8e8 commit a961df7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
23 changes: 20 additions & 3 deletions adafruit_ws2801.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class WS2801(adafruit_pixelbuf.PixelBuf):
:param bool auto_write: True if the dotstars should immediately change when
set. If False, `show` must be called explicitly.
:param str pixel_order: Set the pixel order on the strip - different
strips implement this differently. If you send red, and it looks blue
or green on the strip, modify this! It should be one of the values above.
strips implement this differently. If you send red, and it looks blue
or green on the strip, modify this! It should be one of the values above.
Example for Gemma M0:
Expand All @@ -72,6 +72,23 @@ class WS2801(adafruit_pixelbuf.PixelBuf):
with adafruit_ws2801.WS2801(board.D2, board.D0, 25, brightness=1.0) as pixels:
pixels[0] = darkred
time.sleep(2)
.. py:method:: show()
Shows the new colors on the ws2801 LEDs themselves if they haven't already
been autowritten.
The colors may or may not be showing after this function returns because
it may be done asynchronously.
.. py:method:: fill(color)
Colors all ws2801 LEDs the given ***color***.
.. py:attribute:: brightness
Overall brightness of all ws2801 LEDs (0 to 1.0)
"""

def __init__( # pylint: disable=too-many-arguments
Expand Down Expand Up @@ -119,7 +136,7 @@ def __init__( # pylint: disable=too-many-arguments
)

def deinit(self) -> None:
"""Blank out the DotStars and release the resources."""
"""Blank out the ws2801 LEDs and release the resources."""
self.fill(0)
self.show()
if self._spi:
Expand Down
3 changes: 3 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
.. If your library file(s) are nested in a directory (e.g. /adafruit_foo/foo.py)
.. use this format as the module name: "adafruit_foo.foo"
API Reference
=============

.. automodule:: adafruit_ws2801
:members:

0 comments on commit a961df7

Please sign in to comment.