Skip to content

Commit a69f2a9

Browse files
committed
Handle app/javascript as json. Fix missing text position error
1 parent 6511953 commit a69f2a9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

adafruit_pyportal.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ def __init__(
375375
self.set_caption(caption_text, caption_position, caption_color)
376376

377377
if text_font:
378-
if isinstance(text_position[0], (list, tuple)):
378+
if text_position is not None and isinstance(text_position[0], (list, tuple)):
379379
num = len(text_position)
380380
if not text_wrap:
381381
text_wrap = [0] * num
@@ -933,6 +933,8 @@ def fetch(self, refresh_url=None, timeout=10):
933933
content_type = CONTENT_IMAGE
934934
elif "application/json" in headers["content-type"]:
935935
content_type = CONTENT_JSON
936+
elif "application/javascript" in headers["content-type"]:
937+
content_type = CONTENT_JSON
936938
else:
937939
print(
938940
"HTTP Error {}: {}".format(r.status_code, r.reason.decode("utf-8"))

0 commit comments

Comments
 (0)