@@ -375,7 +375,9 @@ def __init__(
375
375
self .set_caption (caption_text , caption_position , caption_color )
376
376
377
377
if text_font :
378
- if isinstance (text_position [0 ], (list , tuple )):
378
+ if text_position is not None and isinstance (
379
+ text_position [0 ], (list , tuple )
380
+ ):
379
381
num = len (text_position )
380
382
if not text_wrap :
381
383
text_wrap = [0 ] * num
@@ -819,8 +821,8 @@ def _connect_esp(self):
819
821
@staticmethod
820
822
def image_converter_url (image_url , width , height , color_depth = 16 ):
821
823
"""Generate a converted image url from the url passed in,
822
- with the given width and height. aio_username and aio_key must be
823
- set in secrets."""
824
+ with the given width and height. aio_username and aio_key must be
825
+ set in secrets."""
824
826
try :
825
827
aio_username = secrets ["aio_username" ]
826
828
aio_key = secrets ["aio_key" ]
@@ -933,6 +935,8 @@ def fetch(self, refresh_url=None, timeout=10):
933
935
content_type = CONTENT_IMAGE
934
936
elif "application/json" in headers ["content-type" ]:
935
937
content_type = CONTENT_JSON
938
+ elif "application/javascript" in headers ["content-type" ]:
939
+ content_type = CONTENT_JSON
936
940
else :
937
941
print (
938
942
"HTTP Error {}: {}" .format (r .status_code , r .reason .decode ("utf-8" ))
@@ -1161,8 +1165,7 @@ def show_QR(
1161
1165
self ._qr_only = hide_background
1162
1166
1163
1167
def hide_QR (self ): # pylint: disable=invalid-name
1164
- """Clear any QR codes that are currently on the screen
1165
- """
1168
+ """Clear any QR codes that are currently on the screen"""
1166
1169
1167
1170
if self ._qr_only :
1168
1171
board .DISPLAY .show (self .splash )
0 commit comments