Skip to content

Commit 4addb54

Browse files
committed
weather display matrix cp7 updates
1 parent bd7536a commit 4addb54

1 file changed

Lines changed: 30 additions & 10 deletions

File tree

Weather_Display_Matrix/openweather_graphics.py

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def __init__(
3232
am_pm=True,
3333
units="imperial"
3434
):
35-
super().__init__(max_size=3)
35+
super().__init__()
3636
self.am_pm = am_pm
3737
if units == "metric":
3838
self.celsius = True
@@ -42,28 +42,34 @@ def __init__(
4242
self.meters_speed = False
4343
self.display = display
4444

45-
splash = displayio.Group(max_size=1)
45+
splash = displayio.Group()
46+
# CircuitPython 6 & 7 compatible
4647
background = displayio.OnDiskBitmap(open("loading.bmp", "rb"))
4748
bg_sprite = displayio.TileGrid(
4849
background,
4950
pixel_shader=getattr(background, 'pixel_shader', displayio.ColorConverter()),
5051
)
52+
# # CircuitPython 7+ compatible
53+
# background = displayio.OnDiskBitmap("loading.bmp")
54+
# bg_sprite = displayio.TileGrid(background, pixel_shader=background.pixel_shader)
55+
5156
splash.append(bg_sprite)
5257
display.show(splash)
5358

54-
self.root_group = displayio.Group(max_size=15)
59+
self.root_group = displayio.Group()
5560
self.root_group.append(self)
56-
self._icon_group = displayio.Group(max_size=1)
61+
self._icon_group = displayio.Group()
5762
self.append(self._icon_group)
58-
self._text_group = displayio.Group(max_size=5)
63+
self._text_group = displayio.Group()
5964
self.append(self._text_group)
60-
self._scrolling_group = displayio.Group(max_size=1)
65+
self._scrolling_group = displayio.Group()
6166
self.append(self._scrolling_group)
6267

6368
# The label index we're currently scrolling
6469
self._current_label = None
6570

6671
# Load the icon sprite sheet
72+
# CircuitPython 6 & 7 compatible
6773
icons = displayio.OnDiskBitmap(open(icon_spritesheet, "rb"))
6874
self._icon_sprite = displayio.TileGrid(
6975
icons,
@@ -76,6 +82,20 @@ def __init__(
7682
x=0,
7783
y=0,
7884
)
85+
# # CircuitPython 7+ compatible
86+
# icons = displayio.OnDiskBitmap(icon_spritesheet)
87+
# self._icon_sprite = displayio.TileGrid(
88+
# icons,
89+
# pixel_shader=icons.pixel_shader,
90+
# width=1,
91+
# height=1,
92+
# tile_width=icon_width,
93+
# tile_height=icon_height,
94+
# default_tile=0,
95+
# x=0,
96+
# y=0,
97+
# )
98+
7999
self.set_icon(None)
80100
self._scrolling_texts = []
81101

@@ -88,21 +108,21 @@ def __init__(
88108

89109
self.city_text = None
90110

91-
self.temp_text = Label(self.medium_font, max_glyphs=6)
111+
self.temp_text = Label(self.medium_font)
92112
self.temp_text.x = 20
93113
self.temp_text.y = 7
94114
self.temp_text.color = TEMP_COLOR
95115
self._text_group.append(self.temp_text)
96116

97-
self.description_text = Label(self.small_font, max_glyphs=60)
117+
self.description_text = Label(self.small_font)
98118
self.description_text.color = DESCRIPTION_COLOR
99119
self._scrolling_texts.append(self.description_text)
100120

101-
self.humidity_text = Label(self.small_font, max_glyphs=14)
121+
self.humidity_text = Label(self.small_font)
102122
self.humidity_text.color = HUMIDITY_COLOR #
103123
self._scrolling_texts.append(self.humidity_text)
104124

105-
self.wind_text = Label(self.small_font, max_glyphs=10)
125+
self.wind_text = Label(self.small_font)
106126
self.wind_text.color = WIND_COLOR
107127
self._scrolling_texts.append(self.wind_text)
108128

0 commit comments

Comments
 (0)