@@ -111,7 +111,7 @@ class IS31FL3731:
111
111
112
112
:param ~busio.I2C i2c: the connected i2c bus i2c_device
113
113
:param int address: the device address; defaults to 0x74
114
- :param int frames: static 0 or animation frames ( 0-7)
114
+ :param Iterable frames: list of frame indexes to use. int's 0-7.
115
115
"""
116
116
117
117
width : int = 16
@@ -120,14 +120,16 @@ class IS31FL3731:
120
120
def __init__ (
121
121
self ,
122
122
i2c : busio .I2C ,
123
- frames : Optional [int ] = None ,
123
+ frames : Optional [Iterable ] = None ,
124
124
address : int = 0x74 ,
125
125
):
126
126
self .i2c_device = I2CDevice (i2c , address )
127
127
self ._frame = None
128
128
self ._init (frames = frames )
129
129
130
- def _i2c_read_reg (self , reg : Optional [int ] = None , result : Optional [int ] = None ):
130
+ def _i2c_read_reg (
131
+ self , reg : Optional [int ] = None , result : Optional [WriteableBuffer ] = None
132
+ ) -> Optional [WriteableBuffer ]:
131
133
# Read a buffer of data from the specified 8-bit I2C register address.
132
134
# The provided result parameter will be filled to capacity with bytes
133
135
# of data read from the register.
@@ -190,13 +192,13 @@ def _init(self, frames: Iterable) -> None:
190
192
self ._frame = 0 # To match config bytes above
191
193
self .sleep (False )
192
194
193
- def reset (self ):
195
+ def reset (self ) -> None :
194
196
"""Kill the display for 10MS"""
195
197
self .sleep (True )
196
198
time .sleep (0.01 ) # 10 MS pause to reset.
197
199
self .sleep (False )
198
200
199
- def sleep (self , value ) :
201
+ def sleep (self , value : bool ) -> Optional [ int ] :
200
202
"""
201
203
Set the Software Shutdown Register bit
202
204
@@ -206,10 +208,10 @@ def sleep(self, value):
206
208
207
209
def autoplay (
208
210
self ,
209
- delay : Optional [ int ] = None ,
210
- loops : Optional [ Iterable ] = None ,
211
- frames : Optional [ int ] = None ,
212
- ) -> int :
211
+ delay : int = 0 ,
212
+ loops : int = 0 ,
213
+ frames : int = 0 ,
214
+ ) -> None :
213
215
"""
214
216
Start autoplay
215
217
@@ -235,7 +237,7 @@ def fade(
235
237
self ,
236
238
fade_in : Optional [int ] = None ,
237
239
fade_out : Optional [int ] = None ,
238
- pause : Optional [ int ] = None ,
240
+ pause : int = 0 ,
239
241
) -> int :
240
242
"""
241
243
Start and stop the fade feature. If both fade_in and fade_out are None (the
@@ -314,7 +316,7 @@ def audio_play(
314
316
)
315
317
self ._mode (_AUDIOPLAY_MODE )
316
318
317
- def blink (self , rate : Optional [int ]) -> Optional [int ]:
319
+ def blink (self , rate : Optional [int ] = None ) -> Optional [int ]:
318
320
"""Updates the blink register"""
319
321
# pylint: disable=no-else-return
320
322
# This needs to be refactored when it can be tested
@@ -435,7 +437,9 @@ def pixel(
435
437
436
438
# pylint: enable-msg=too-many-arguments
437
439
438
- def image (self , img : Optional [str ], frame : Optional [int ], blink : bool = False ):
440
+ def image (
441
+ self , img : Image , frame : Optional [int ] = None , blink : bool = False
442
+ ) -> None :
439
443
"""Set buffer to value of Python Imaging Library image. The image should
440
444
be in 8-bit mode (L) and a size equal to the display size.
441
445
0 commit comments