@@ -182,11 +182,21 @@ def __init__(
182
182
debug = debug ,
183
183
)
184
184
185
- self .peripherals = Peripherals (spi , display = self .display , debug = debug )
185
+ # Convenience Shortcuts for compatibility
186
+ self .peripherals = Peripherals (
187
+ spi , display = self .display , splash_group = self .splash , debug = debug
188
+ )
186
189
self .set_backlight = self .peripherals .set_backlight
187
190
self .sd_check = self .peripherals .sd_check
188
191
self .play_file = self .peripherals .play_file
189
192
193
+ self .image_converter_url = self .network .image_converter_url
194
+ self .wget = self .network .wget
195
+ # pylint: disable=invalid-name
196
+ self .show_QR = self .graphics .qrcode
197
+ self .hide_QR = self .graphics .hide_QR
198
+ # pylint: enable=invalid-name
199
+
190
200
if hasattr (self .peripherals , "touchscreen" ):
191
201
self .touchscreen = self .peripherals .touchscreen
192
202
if hasattr (self .peripherals , "mouse_cursor" ):
@@ -288,22 +298,6 @@ def set_caption(self, caption_text, caption_position, caption_color):
288
298
)
289
299
self .set_text (caption_text , index )
290
300
291
- def image_converter_url (self , image_url , width , height , color_depth = 16 ):
292
- """Generate a converted image url from the url passed in,
293
- with the given width and height. aio_username and aio_key must be
294
- set in secrets."""
295
- return self .network .image_converter_url (image_url , width , height , color_depth )
296
-
297
- def wget (self , url , filename , * , chunk_size = 12000 ):
298
- """Download a url and save to filename location, like the command wget.
299
-
300
- :param url: The URL from which to obtain the data.
301
- :param filename: The name of the file to save the data to.
302
- :param chunk_size: how much data to read/write at a time.
303
-
304
- """
305
- return self .network .wget (url , filename , chunk_size = chunk_size )
306
-
307
301
def fetch (self , refresh_url = None , timeout = 10 ):
308
302
"""Fetch data from the url we initialized with, perfom any parsing,
309
303
and display text or graphics. This function does pretty much everything
@@ -368,27 +362,3 @@ def fetch(self, refresh_url=None, timeout=10):
368
362
gc .collect ()
369
363
370
364
return values
371
-
372
- def show_QR (
373
- self , qr_data , * , qr_size = 1 , x = 0 , y = 0 , hide_background = False
374
- ): # pylint: disable=invalid-name
375
- """Display a QR code on the TFT
376
-
377
- :param qr_data: The data for the QR code.
378
- :param int qr_size: The scale of the QR code.
379
- :param x: The x position of upper left corner of the QR code on the display.
380
- :param y: The y position of upper left corner of the QR code on the display.
381
- :param hide_background: Show the QR code on a black background if True.
382
-
383
- """
384
- self .graphics .qrcode (
385
- qr_data ,
386
- qr_size = qr_size ,
387
- x = x ,
388
- y = y ,
389
- hide_background = hide_background ,
390
- )
391
-
392
- def hide_QR (self ): # pylint: disable=invalid-name
393
- """Clear any QR codes that are currently on the screen"""
394
- self .graphics .hide_qrcode ()
0 commit comments