Skip to content

Commit a863802

Browse files
committed
Docstring updates
1 parent 61ae9e4 commit a863802

File tree

3 files changed

+23
-21
lines changed

3 files changed

+23
-21
lines changed

adafruit_ht16k33/ht16k33.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class HT16K33:
3535
The base class for all displays. Contains common methods.
3636
3737
:param ~busio.I2C i2c: The I2C bus object
38-
:param int address: The I2C addess of the HT16K33.
38+
:param int|list|tuple address: The I2C addess(es) of the HT16K33.
3939
:param bool auto_write: True if the display should immediately change when
4040
set. If False, `show` must be called explicitly.
4141
:param float brightness: 0.0 - 1.0 default brightness level.

adafruit_ht16k33/matrix.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,9 @@ def pixel(self, x: int, y: int, color: Optional[int] = None) -> Optional[int]:
235235
236236
:param int x: The x coordinate of the pixel
237237
:param int y: The y coordinate of the pixel
238-
:param bool color: (Optional) The state to set the pixel
238+
:param int color: (Optional) The color to set the pixel
239239
:return: If ``color`` was not set, this returns the state of the pixel
240-
:rtype: bool
240+
:rtype: int
241241
"""
242242
if not 0 <= x <= 7:
243243
return None
@@ -253,7 +253,7 @@ def pixel(self, x: int, y: int, color: Optional[int] = None) -> Optional[int]:
253253
def fill(self, color: int) -> None:
254254
"""Fill the whole display with the given color.
255255
256-
:param bool color: Whether to fill the display
256+
:param int color: The color to fill the display
257257
"""
258258

259259
fill1 = 0xFF if color & 0x01 else 0x00

adafruit_ht16k33/segments.py

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ class Seg14x4(HT16K33):
146146
"""Alpha-Numeric 14-segment display.
147147
148148
:param I2C i2c: The I2C bus object
149-
:param address: The I2C address for the display. Can be a tuple or list for multiple displays.
149+
:param int|list|tuple address: The I2C address(es) for the display. Can be a tuple or list for multiple displays.
150150
:param bool auto_write: True if the display should immediately change when set. If False,
151151
`show` must be called explicitly.
152152
:param int chars_per_display: A number between 1-8 represesenting the number of characters
@@ -156,7 +156,7 @@ class Seg14x4(HT16K33):
156156
def __init__(
157157
self,
158158
i2c: I2C,
159-
address=0x70,
159+
address: Union[int, List[int], Tuple[int, ...]] = 0x70,
160160
auto_write: Union[int, List[int], Tuple[int, ...]] = True,
161161
chars_per_display: int = 4,
162162
) -> None:
@@ -172,8 +172,7 @@ def __init__(
172172
def print(self, value: Union[str, float], decimal: int = 0) -> None:
173173
"""Print the value to the display.
174174
175-
:param value: The value to print
176-
:type value: str, int, or float
175+
:param str|float value: The value to print
177176
:param int decimal: The number of decimal places for a floating point
178177
number if decimal is greater than zero, or the input number is an
179178
integer if decimal is zero.
@@ -191,15 +190,15 @@ def print(self, value: Union[str, float], decimal: int = 0) -> None:
191190
def print_hex(self, value: Union[int, str]) -> None:
192191
"""Print the value as a hexidecimal string to the display.
193192
194-
:param int value: The number to print
193+
:param int|str value: The number to print
195194
"""
196195

197196
if isinstance(value, int):
198197
self.print("{0:X}".format(value))
199198
else:
200199
self.print(value)
201200

202-
def __setitem__(self, key, value):
201+
def __setitem__(self, key: int, value: str) -> None:
203202
self._put(value, key)
204203
if self._auto_write:
205204
self.show()
@@ -256,13 +255,12 @@ def _number(self, number: float, decimal: int = 0) -> str:
256255
"""
257256
Display a floating point or integer number on the Adafruit HT16K33 based displays
258257
259-
Param: number - The floating point or integer number to be displayed, which must be
260-
in the range 0 (zero) to 9999 for integers and floating point or integer numbers
261-
and between 0.0 and 999.0 or 99.00 or 9.000 for floating point numbers.
262-
Param: decimal - The number of decimal places for a floating point number if decimal
263-
is greater than zero, or the input number is an integer if decimal is zero.
264-
265-
Returns: The output text string to be displayed.
258+
:parma float number: The floating point or integer number to be displayed, which must be
259+
in the range 0 (zero) to 9999 for integers and floating point or integer numbers
260+
and between 0.0 and 999.0 or 99.00 or 9.000 for floating point numbers.
261+
:param int decimal: The number of decimal places for a floating point number if decimal
262+
is greater than zero, or the input number is an integer if decimal is zero.
263+
:return: The output text string to be displayed
266264
"""
267265

268266
auto_write = self._auto_write
@@ -328,7 +326,7 @@ def set_digit_raw(
328326
329327
:param int index: The index of the display to set
330328
:param bitmask: A 2 byte number corresponding to the segments to set
331-
:type bitmask: int, or a list/tuple of bool
329+
:type bitmask: int, or a list/tuple of int
332330
"""
333331
if not isinstance(index, int) or not 0 <= index <= self._chars - 1:
334332
raise ValueError(
@@ -490,11 +488,13 @@ class Seg7x4(_AbstractSeg7x4):
490488
supports displaying a limited set of characters.
491489
492490
:param I2C i2c: The I2C bus object
493-
:param address: The I2C address for the display. Can be a tuple or list for multiple displays.
491+
:param int|list|tuple address: The I2C address for the display. Can be a tuple or list for multiple displays.
494492
:param bool auto_write: True if the display should immediately change when set. If False,
495493
`show` must be called explicitly.
494+
:param dict char_dict: An optional dictionary mapping strings to bit settings integers used
495+
for defining how to display custom letters
496496
:param int chars_per_display: A number between 1-8 represesenting the number of characters
497-
on each display.
497+
on each display.
498498
"""
499499

500500
def __init__( # pylint: disable=too-many-arguments
@@ -524,9 +524,11 @@ class BigSeg7x4(_AbstractSeg7x4):
524524
supports displaying a limited set of characters.
525525
526526
:param I2C i2c: The I2C bus object
527-
:param int address: The I2C address for the display
527+
:param int|list|tuple address: The I2C address(es) for the display
528528
:param bool auto_write: True if the display should immediately change when set. If False,
529529
`show` must be called explicitly.
530+
:param dict char_dict: An optional dictionary mapping strings to bit settings integers used
531+
for defining how to display custom letters
530532
"""
531533

532534
def __init__(

0 commit comments

Comments
 (0)