As-is this guide will not work.
A few issues I uncovered
https://raw.githubusercontent.com/adafr ... 01_13.json is the URL (or similar) that it tries to connect to.
Code: Select all
< HTTP/2 200
< cache-control: max-age=300
< content-security-policy: default-src 'none'; style-src 'unsafe-inline'; sandbox
< content-type: text/plain; charset=utf-8
The quickest and easiest fix would be for the adafruit github to return an expected json content-type header.
Assuming that is not possible, I have some simple code I could wrap into a pull request for portalbase network.py
Code: Select all
if "text/plain" in headers["content-type"] and json_path:
return CONTENT_JSON
The main reason why I'm putting this in a forum post, vs a github issue is it's either fixed via some github json setting, or in code it touches multiple projects and should be committed at the same time.
A side note, an unintended breakage found in bitmap label parsing came up when trying to parse json as text. in displaytext bitmaplabel If the text is empty / just new lines, then left is always set to None for this block of code and will crash at the bottom when trying to subtract.
Elsewhere there is a check if left is None: left = 0. I'm conflicted whether left should be set to zero, or to x_start, which seems more appropriate.