Skip to content

Change deprecated splash usage to root_group #3087

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions FunHouse_Fume_Extractor/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
group = displayio.Group()
# adding start-up bitmap to group
group.append(tile_grid)
funhouse.splash.append(group)
funhouse.graphics.root_group.append(group)
# text for fume data
fume_text = funhouse.add_text(
text=" ",
Expand All @@ -74,7 +74,7 @@
text_font="fonts/Arial-Bold-24.pcf",
)
# showing graphics
funhouse.display.root_group = funhouse.splash
funhouse.display.root_group = funhouse.graphics.root_group

# state machines
run = False # state if main code is running
Expand Down
4 changes: 2 additions & 2 deletions FunHouse_HA_Companion/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@
)

# Now display the splash to draw all labels at once
funhouse.display.root_group = funhouse.splash
funhouse.display.root_group = funhouse.graphics.root_group

status = Circle(229, 10, 10, fill=0xFF0000, outline=0x880000)
funhouse.splash.append(status)
funhouse.graphics.root_group.append(status)

def connected(client, _userdata, _result, _payload):
status.fill = 0x00FF00
Expand Down
2 changes: 1 addition & 1 deletion FunHouse_LIFX/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def set_label_color(conditional, index, on_color):
text=trip_time, text_scale=2, text_position=(30, 25), text_color=0x606060
)

funhouse.display.root_group = funhouse.splash
funhouse.display.root_group = funhouse.graphics.root_group

# Turn on the light
print("Turning on light...")
Expand Down
2 changes: 1 addition & 1 deletion FunHouse_Mailslot/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
)
reset_label = funhouse.add_text(text="reset", text_position=(3, 70), text_color=GRAY)

funhouse.display.root_group = funhouse.splash
funhouse.display.root_group = funhouse.graphics.root_group


def send_io_data(mail_value):
Expand Down
4 changes: 2 additions & 2 deletions FunHouse_Motion_Outlet/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ def timeleft():
text_color=0xFFFF00,
text_font="fonts/Arial-Bold-24.pcf",
)
funhouse.display.root_group = funhouse.splash
funhouse.display.root_group = funhouse.graphics.root_group

status = Circle(229, 10, 10, fill=0xFF0000, outline=0x880000)
funhouse.splash.append(status)
funhouse.graphics.root_group.append(status)

# Initialize a new MQTT Client object
if USE_MQTT:
Expand Down
4 changes: 2 additions & 2 deletions FunHouse_Pet_Bowl_Sensor/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ def bowl_level_display(level):
text_color=0xFFFF00,
text_font="fonts/Arial-Bold-24.pcf",
)
funhouse.display.root_group = funhouse.splash
funhouse.display.root_group = funhouse.graphics.root_group

status = Circle(229, 10, 10, fill=0xFF0000, outline=0x880000)
funhouse.splash.append(status)
funhouse.graphics.root_group.append(status)

# Initialize a new MQTT Client object
funhouse.network.init_mqtt(
Expand Down
4 changes: 2 additions & 2 deletions MagTag/MagTag_Covid_Vaccination/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
BAR_X, 95, BAR_WIDTH, BAR_HEIGHT, 1.0, bar_color=0x999999, outline_color=0x000000
)

magtag.graphics.splash.append(progress_bar)
magtag.graphics.splash.append(progress_bar_1)
magtag.graphics.root_group.append(progress_bar)
magtag.graphics.root_group.append(progress_bar_1)
magtag.graphics.set_background("/bmps/background.bmp")


Expand Down
2 changes: 1 addition & 1 deletion MagTag/MagTag_Flashcards/chapters/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

# Add button labels at the bottom of the screen
BUTTON_TEXT_IDX = list_len
magtag.graphics.splash.append(Rect(0, magtag.graphics.display.height - 14,
magtag.graphics.root_group.append(Rect(0, magtag.graphics.display.height - 14,
magtag.graphics.display.width,
magtag.graphics.display.height, fill=0x0))
magtag.add_text(
Expand Down
18 changes: 9 additions & 9 deletions MagTag/MagTag_Google_Calendar/authenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
display = graphics.display

background = Rect(0, 0, 296, 128, fill=0xFFFFFF)
graphics.splash.append(background)
graphics.root_group.append(background)

label_overview_text = Label(
font_large,
Expand All @@ -42,18 +42,18 @@
color=0x000000,
text="Authorize this device with Google:",
)
graphics.splash.append(label_overview_text)
graphics.root_group.append(label_overview_text)

label_verification_url = Label(font_small, x=0, y=40, line_spacing=0.75, color=0x000000)
graphics.splash.append(label_verification_url)
graphics.root_group.append(label_verification_url)

label_user_code = Label(font_small, x=0, y=80, color=0x000000, line_spacing=0.75)
graphics.splash.append(label_user_code)
graphics.root_group.append(label_user_code)

label_qr_code = Label(
font_small, x=0, y=100, color=0x000000, text="Or scan the QR code:"
)
graphics.splash.append(label_qr_code)
graphics.root_group.append(label_qr_code)

# Set scope(s) of access required by the API you're using
scopes = ["https://www.googleapis.com/auth/calendar.readonly"]
Expand Down Expand Up @@ -85,7 +85,7 @@
label_user_code.text = "2. Enter code: %s" % google_auth.user_code

graphics.qrcode(google_auth.verification_url.encode(), qr_size=2, x=240, y=70)
graphics.display.root_group = graphics.splash
graphics.display.root_group = graphics.root_group
display.refresh()

# Poll Google's authorization server
Expand All @@ -98,9 +98,9 @@
print(f'google_access_token="{google_auth.access_token}"')
print(f'google_refresh_token="{google_auth.refresh_token}"')

graphics.splash.pop()
graphics.splash.pop()
graphics.splash.pop()
graphics.root_group.pop()
graphics.root_group.pop()
graphics.root_group.pop()

label_overview_text.text = "Successfully Authenticated!"
label_verification_url.text = (
Expand Down
2 changes: 1 addition & 1 deletion MagTag/MagTag_Google_Calendar/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def display_calendar_events(resp_events):

# Add the header
line_header = Line(0, 30, 320, 30, color=0x000000)
magtag.splash.append(line_header)
magtag.graphics.root_group.append(line_header)

label_header = magtag.add_text(
text_font="fonts/Arial-18.pcf",
Expand Down
2 changes: 1 addition & 1 deletion MagTag/MagTag_Google_Sheets/naughty_nice/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def hh_mm(time_struct, twelve_hour=True):

# Add 14-pixel-tall black bar at bottom of display. It's a distinct layer
# (not just background) to appear on top of name list if it runs long.
MAGTAG.graphics.splash.append(Rect(0, MAGTAG.graphics.display.height - 14,
MAGTAG.graphics.root_group.append(Rect(0, MAGTAG.graphics.display.height - 14,
MAGTAG.graphics.display.width,
MAGTAG.graphics.display.height, fill=0x0))

Expand Down
2 changes: 1 addition & 1 deletion MagTag/MagTag_Google_Sheets/weekly_planner/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def hh_mm(time_struct, twelve_hour=True):

# Add 14-pixel-tall black bar at bottom of display. It's a distinct layer
# (not just background) to appear on top of task list if it runs long.
MAGTAG.graphics.splash.append(Rect(0, MAGTAG.graphics.display.height - 14,
MAGTAG.graphics.root_group.append(Rect(0, MAGTAG.graphics.display.height - 14,
MAGTAG.graphics.display.width,
MAGTAG.graphics.display.height, fill=0x0))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def texturl_transform(val):
BAR_X, BAR_Y, BAR_WIDTH, BAR_HEIGHT, 1.0, bar_color=0x999999, outline_color=0x000000
)

magtag.graphics.splash.append(progress_bar)
magtag.graphics.root_group.append(progress_bar)

timestamp = None

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def days_in_year(date_obj):
BAR_X, BAR_Y, BAR_WIDTH, BAR_HEIGHT, 1.0, bar_color=0x999999, outline_color=0x000000
)

magtag.graphics.splash.append(progress_bar)
magtag.graphics.root_group.append(progress_bar)


try:
Expand Down
2 changes: 1 addition & 1 deletion MagTag/MagTag_Seasonal_Produce/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def hh_mm(time_struct, twelve_hour=True):

# Add 14-pixel-tall black bar at bottom of display. It's a distinct layer
# (not just background) to appear on top of produce list if it runs long.
MAGTAG.graphics.splash.append(Rect(0, MAGTAG.graphics.display.height - 14,
MAGTAG.graphics.root_group.append(Rect(0, MAGTAG.graphics.display.height - 14,
MAGTAG.graphics.display.width,
MAGTAG.graphics.display.height, fill=0x0))

Expand Down
12 changes: 6 additions & 6 deletions MagTag/MagTag_Tides/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@
# ----------------------------
# Add all the graphic layers
# ----------------------------
magtag.splash.append(tide_tg)
magtag.splash.append(grid_overlay)
magtag.splash.append(plot_y_labels)
magtag.splash.append(tide_info)
magtag.splash.append(date_label)
magtag.splash.append(station_info)
magtag.graphics.root_group.append(tide_tg)
magtag.graphics.root_group.append(grid_overlay)
magtag.graphics.root_group.append(plot_y_labels)
magtag.graphics.root_group.append(tide_info)
magtag.graphics.root_group.append(date_label)
magtag.graphics.root_group.append(station_info)

# /////////////////////////////////////////////////////////////////////////

Expand Down
4 changes: 2 additions & 2 deletions MagTag/MagTag_Weather/forecast/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,9 @@ def go_to_sleep(current_time):
make_banner(x=210, y=81),
]

magtag.splash.append(today_banner)
magtag.graphics.root_group.append(today_banner)
for future_banner in future_banners:
magtag.splash.append(future_banner)
magtag.graphics.root_group.append(future_banner)

# ===========
# M A I N
Expand Down
4 changes: 2 additions & 2 deletions MagTag/MagTag_Weather/onecall/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,9 @@ def go_to_sleep(current_time):
make_banner(x=210, y=102),
]

magtag.splash.append(today_banner)
magtag.graphics.root_group.append(today_banner)
for future_banner in future_banners:
magtag.splash.append(future_banner)
magtag.graphics.root_group.append(future_banner)

# ===========
# M A I N
Expand Down
4 changes: 2 additions & 2 deletions MagTag/MagTag_Weather/openmeteo/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,9 @@ def go_to_sleep(current_time_secs):
make_banner(x=210, y=102),
]

magtag.splash.append(today_banner)
magtag.graphics.root_group.append(today_banner)
for future_banner in future_banners:
magtag.splash.append(future_banner)
magtag.graphics.root_group.append(future_banner)

# ===========
# M A I N
Expand Down
12 changes: 6 additions & 6 deletions PyPortal/PyPortal_Alarm_Clock/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ def create_text_areas(configs):


def clear_splash():
for _ in range(len(pyportal.splash) - 1):
pyportal.splash.pop()
for _ in range(len(pyportal.root_group) - 1):
pyportal.root_group.pop()


def touch_in_button(t, b):
Expand Down Expand Up @@ -337,8 +337,8 @@ def touch(self, t, touched):
def enter(self):
self.adjust_backlight_based_on_light(force=True)
for ta in self.text_areas:
pyportal.splash.append(ta)
pyportal.splash.append(self.weather_icon)
pyportal.root_group.append(ta)
pyportal.root_group.append(self.weather_icon)
if snooze_time:
# CircuitPython 6 & 7 compatible
if self.snooze_file:
Expand All @@ -348,7 +348,7 @@ def enter(self):
icon_sprite = displayio.TileGrid(icon, pixel_shader=icon.pixel_shader)

self.snooze_icon.append(icon_sprite)
pyportal.splash.append(self.snooze_icon)
pyportal.root_group.append(self.snooze_icon)
if alarm_enabled:
self.text_areas[1].text = '%2d:%02d' % (alarm_hour, alarm_minute)
else:
Expand Down Expand Up @@ -532,7 +532,7 @@ def enter(self):

pyportal.set_background(self.background)
for ta in self.text_areas:
pyportal.splash.append(ta)
pyportal.root_group.append(ta)
if alarm_enabled:
self.text_areas[0].text = '%02d:%02d' % (alarm_hour, alarm_minute) # set time textarea
else:
Expand Down
4 changes: 2 additions & 2 deletions PyPortal/PyPortal_Astronauts/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@
names_textarea.x = names_position[0]
names_textarea.y = names_position[1]
names_textarea.color = names_color
pyportal.splash.append(names_textarea)
pyportal.root_group.append(names_textarea)
time.sleep(30) # wait 30 seconds to read it
pyportal.splash.pop()
pyportal.root_group.pop()
2 changes: 1 addition & 1 deletion PyPortal/PyPortal_CMA_Art_Frame/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
text_color=0xFFFFFF)

circle = Circle(WIDTH - 8, HEIGHT - 7, 5, fill=0)
pyportal.splash.append(circle)
pyportal.root_group.append(circle)
loopcount = 0
errorcount = 0
while True:
Expand Down
2 changes: 1 addition & 1 deletion PyPortal/PyPortal_CircuitPython_2020/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
textarea.x = pos[0]
textarea.y = pos[1]
textarea.color = text_color
pyportal.splash.append(textarea)
pyportal.root_group.append(textarea)
text_areas.append(textarea)
refresh_time = None

Expand Down
2 changes: 1 addition & 1 deletion PyPortal/PyPortal_Electioncal_US/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
default_bg=0x000000)


gfx = electioncal_graphics.Electioncal_Graphics(pyportal.splash, am_pm=True)
gfx = electioncal_graphics.Electioncal_Graphics(pyportal.root_group, am_pm=True)
display_refresh = None
while True:
# only query the online time once per hour (and on first run)
Expand Down
2 changes: 1 addition & 1 deletion PyPortal/PyPortal_EventCountdown/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
textarea.x = pos[0]
textarea.y = pos[1]
textarea.color = text_color
pyportal.splash.append(textarea)
pyportal.root_group.append(textarea)
text_areas.append(textarea)
refresh_time = None

Expand Down
2 changes: 1 addition & 1 deletion PyPortal/PyPortal_EventCountup/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
textarea.x = pos[0]
textarea.y = pos[1]
textarea.color = text_color
pyportal.splash.append(textarea)
pyportal.root_group.append(textarea)
text_areas.append(textarea)
refresh_time = None

Expand Down
16 changes: 8 additions & 8 deletions PyPortal/PyPortal_Google_Calendar/authenticator/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@
label_overview_text = Label(
font_large, x=0, y=45, text="To authorize this device with Google:"
)
graphics.splash.append(label_overview_text)
graphics.root_group.append(label_overview_text)

label_verification_url = Label(font_small, x=0, y=100, line_spacing=1)
graphics.splash.append(label_verification_url)
graphics.root_group.append(label_verification_url)

label_user_code = Label(font_small, x=0, y=150)
graphics.splash.append(label_user_code)
graphics.root_group.append(label_user_code)

label_qr_code = Label(font_small, x=0, y=190, text="Or scan the QR code:")
graphics.splash.append(label_qr_code)
graphics.root_group.append(label_qr_code)

# Set scope(s) of access required by the API you're using
scopes = ["https://www.googleapis.com/auth/calendar.readonly"]
Expand Down Expand Up @@ -71,7 +71,7 @@

# Create a QR code
graphics.qrcode(google_auth.verification_url.encode(), qr_size=2, x=170, y=165)
graphics.display.root_group = graphics.splash
graphics.display.root_group = graphics.root_group

# Poll Google's authorization server
print("Waiting for browser authorization...")
Expand All @@ -85,9 +85,9 @@
print(f'GOOGLE_ACCESS_TOKEN = "{google_auth.access_token}"')
print(f'GOOGLE_REFRESH_TOKEN = "{google_auth.refresh_token}"')
# Remove QR code and code/verification labels
graphics.splash.pop()
graphics.splash.pop()
graphics.splash.pop()
graphics.root_group.pop()
graphics.root_group.pop()
graphics.root_group.pop()

label_overview_text.text = "Successfully Authenticated!"
label_verification_url.text = (
Expand Down
Loading