File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -258,20 +258,21 @@ def tick(self, now):
258258 except IndexError :
259259 pass
260260 filename = "/icons/" + weather_icon_name + ".bmp"
261+
261262 if filename :
263+ # CircuitPython 6 & 7 compatible
262264 if self .icon_file :
263265 self .icon_file .close ()
264266 self .icon_file = open (filename , "rb" )
265267 icon = displayio .OnDiskBitmap (self .icon_file )
266- try :
267- icon_sprite = displayio .TileGrid (icon ,
268- pixel_shader = getattr (icon , 'pixel_shader' , displayio .ColorConverter ()),
269- x = 0 , y = 0 )
270- except TypeError :
271- icon_sprite = displayio .TileGrid (icon ,
272- pixel_shader = getattr (icon , 'pixel_shader' , displayio .ColorConverter ()),
273- position = (0 , 0 ))
274268
269+ icon_sprite = displayio .TileGrid (icon ,
270+ pixel_shader = getattr (icon , 'pixel_shader' , displayio .ColorConverter ()),
271+ x = 0 , y = 0 )
272+
273+ # # CircuitPython 7+ compatible
274+ # icon = displayio.OnDiskBitmap(filename)
275+ # icon_sprite = displayio.TileGrid(icon, pixel_shader=icon.pixel_shader)
275276
276277 self .weather_icon .append (icon_sprite )
277278
You can’t perform that action at this time.
0 commit comments