@@ -332,9 +332,11 @@ def __init__(
332
332
self ,
333
333
i2c : I2C ,
334
334
address : int = 0x70 ,
335
- auto_write : bool = True
335
+ auto_write : bool = True ,
336
+ char_dict : Optional [Dict [str , int ]] = None ,
336
337
) -> None :
337
338
super ().__init__ (i2c , address , auto_write )
339
+ self ._chardict = char_dict
338
340
339
341
def scroll (self , count : int = 1 ) -> None :
340
342
"""Scroll the display by specified number of places.
@@ -417,6 +419,7 @@ def set_digit_raw(self, index: int, bitmask: int) -> None:
417
419
if self ._auto_write :
418
420
self .show ()
419
421
422
+
420
423
class Seg7x4 (_AbstractSeg7x4 ):
421
424
"""Numeric 7-segment display. It has the same methods as the alphanumeric display, but only
422
425
supports displaying a limited set of characters.
@@ -426,17 +429,17 @@ class Seg7x4(_AbstractSeg7x4):
426
429
:param bool auto_write: True if the display should immediately change when set. If False,
427
430
`show` must be called explicitly.
428
431
"""
432
+
429
433
def __init__ (
430
434
self ,
431
435
i2c : I2C ,
432
436
address : int = 0x70 ,
433
437
auto_write : bool = True ,
434
438
char_dict : Optional [Dict [str , int ]] = None ,
435
439
) -> None :
436
- super ().__init__ (i2c , address , auto_write )
440
+ super ().__init__ (i2c , address , auto_write , char_dict )
437
441
# Use colon for controling two-dots indicator at the center (index 0)
438
442
self ._colon = Colon (self )
439
- self ._chardict = char_dict
440
443
441
444
@property
442
445
def colon (self ) -> bool :
@@ -465,11 +468,10 @@ def __init__(
465
468
auto_write : bool = True ,
466
469
char_dict : Optional [Dict [str , int ]] = None ,
467
470
) -> None :
468
- super ().__init__ (i2c , address , auto_write )
471
+ super ().__init__ (i2c , address , auto_write , char_dict )
469
472
# Use colon for controling two-dots indicator at the center (index 0)
470
473
# or the two-dots indicators at the left (index 1)
471
474
self .colons = Colon (self , 2 )
472
- self ._chardict = char_dict
473
475
474
476
def _setindicator (self , index : int , value : bool ) -> None :
475
477
"""Set side LEDs (dots)
@@ -522,6 +524,7 @@ def ampm(self) -> bool:
522
524
def ampm (self , value : bool ) -> None :
523
525
self ._setindicator (3 , value )
524
526
527
+
525
528
class Colon :
526
529
"""Helper class for controlling the colons. Not intended for direct use."""
527
530
0 commit comments