Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions adafruit_pyportal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def set_caption(self, caption_text, caption_position, caption_color):
)
self.set_text(caption_text, index)

def fetch(self, refresh_url=None, timeout=10):
def fetch(self, refresh_url=None, timeout=10, force_content_type=None):
"""Fetch data from the url we initialized with, perfom any parsing,
and display text or graphics. This function does pretty much everything
Optionally update the URL
Expand All @@ -307,7 +307,10 @@ def fetch(self, refresh_url=None, timeout=10):
response = self.network.fetch(self.url, headers=self._headers, timeout=timeout)

json_out = None
content_type = self.network.check_response(response)
if not force_content_type:
content_type = self.network.check_response(response)
else:
content_type = force_content_type
json_path = self._json_path

if content_type == CONTENT_JSON:
Expand Down