Skip to content

Commit 3c81604

Browse files
committed
Update to use new PyPortal AIO image converter
depends on adafruit/Adafruit_CircuitPython_PyPortal#6
1 parent 88d9b33 commit 3c81604

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

PyPortal_Thingiverse/thingiverse.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
default_bg=cwd+"/thingiverse_background.bmp",
2727
text_font=cwd+"/fonts/Arial-12.bdf",
2828
text_position=((5, 5), (5, 200)),
29-
text_color=(0x00FF00, 0x00FF00))
29+
text_color=(0x00FF00, 0x00FF00),
30+
text_transform=(None, None))
3031
pyportal.preload_font()
3132

3233
while True:
@@ -36,8 +37,8 @@
3637
print("Response is", response)
3738
pyportal.set_background(None)
3839
image_url = response[2].replace('_thumb_medium.', '_display_large.')
39-
pyportal.wget(adafruit_pyportal.IMAGE_CONVERTER_SERVICE+image_url, "/cache.bmp")
40-
pyportal.set_background("/cache.bmp")
40+
pyportal.wget(pyportal.image_converter_url(image_url, 320, 240), "/sd/cache.bmp")
41+
pyportal.set_background("/sd/cache.bmp")
4142

4243
except (IndexError, RuntimeError, ValueError) as e:
4344
print("Some error occured, retrying! -", e)
@@ -46,4 +47,4 @@
4647
thingy = random.randint(0, NUM_THINGS - 1)
4748
URL_LOCATION[0] = TITLE_LOCATION[0] = IMAGE_LOCATION[0] = thingy
4849

49-
time.sleep(60 * 3) # cycle every 3 minutes
50+
time.sleep(60 * 3) # cycle every 3 minutes

0 commit comments

Comments
 (0)