Update displayio compatibility
@@ -254,10 +254,16 @@ class Time_State(State):
self.icon_file.close()
self.icon_file = open(filename, "rb")
icon = displayio.OnDiskBitmap(self.icon_file)
+ try:
+ icon_sprite = displayio.TileGrid(icon,
+ pixel_shader=displayio.ColorConverter(),
+ x=0, y=0)
+ except TypeError:
icon_sprite = displayio.TileGrid(icon,
pixel_shader=displayio.ColorConverter(),
position=(0, 0))
+
self.weather_icon.append(icon_sprite)
temperature = weather['main']['temp'] - 273.15 # its...in kelvin
@@ -315,6 +321,11 @@ class Time_State(State):
self.snooze_file.close()
self.snooze_file = open('/icons/zzz.bmp', "rb")
icon = displayio.OnDiskBitmap(self.snooze_file)
+ try:
+ icon_sprite = displayio.TileGrid(icon,
+ pixel_shader=displayio.ColorConverter(),
+ x=0, y=0)
+ except TypeError:
icon_sprite = displayio.TileGrid(icon,
pixel_shader=displayio.ColorConverter(),
position=(0, 0))
