Skip to content

Commit c871a1e

Browse files
committed
blacked and linted
1 parent 83be0d9 commit c871a1e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

adafruit_ht16k33/segments.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,11 @@ def __init__(
332332
self,
333333
i2c: I2C,
334334
address: int = 0x70,
335-
auto_write: bool = True
335+
auto_write: bool = True,
336+
char_dict: Optional[Dict[str, int]] = None,
336337
) -> None:
337338
super().__init__(i2c, address, auto_write)
339+
self._chardict = char_dict
338340

339341
def scroll(self, count: int = 1) -> None:
340342
"""Scroll the display by specified number of places.
@@ -417,6 +419,7 @@ def set_digit_raw(self, index: int, bitmask: int) -> None:
417419
if self._auto_write:
418420
self.show()
419421

422+
420423
class Seg7x4(_AbstractSeg7x4):
421424
"""Numeric 7-segment display. It has the same methods as the alphanumeric display, but only
422425
supports displaying a limited set of characters.
@@ -426,17 +429,17 @@ class Seg7x4(_AbstractSeg7x4):
426429
:param bool auto_write: True if the display should immediately change when set. If False,
427430
`show` must be called explicitly.
428431
"""
432+
429433
def __init__(
430434
self,
431435
i2c: I2C,
432436
address: int = 0x70,
433437
auto_write: bool = True,
434438
char_dict: Optional[Dict[str, int]] = None,
435439
) -> None:
436-
super().__init__(i2c, address, auto_write)
440+
super().__init__(i2c, address, auto_write, char_dict)
437441
# Use colon for controling two-dots indicator at the center (index 0)
438442
self._colon = Colon(self)
439-
self._chardict = char_dict
440443

441444
@property
442445
def colon(self) -> bool:
@@ -465,11 +468,10 @@ def __init__(
465468
auto_write: bool = True,
466469
char_dict: Optional[Dict[str, int]] = None,
467470
) -> None:
468-
super().__init__(i2c, address, auto_write)
471+
super().__init__(i2c, address, auto_write, char_dict)
469472
# Use colon for controling two-dots indicator at the center (index 0)
470473
# or the two-dots indicators at the left (index 1)
471474
self.colons = Colon(self, 2)
472-
self._chardict = char_dict
473475

474476
def _setindicator(self, index: int, value: bool) -> None:
475477
"""Set side LEDs (dots)
@@ -522,6 +524,7 @@ def ampm(self) -> bool:
522524
def ampm(self, value: bool) -> None:
523525
self._setindicator(3, value)
524526

527+
525528
class Colon:
526529
"""Helper class for controlling the colons. Not intended for direct use."""
527530

0 commit comments

Comments
 (0)