Skip to content

Commit 895120f

Browse files
authored
Merge pull request #3087 from FoamyGuy/magtag_updates
Change deprecated splash usage to root_group
2 parents c551004 + 989db55 commit 895120f

File tree

48 files changed

+107
-107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+107
-107
lines changed

FunHouse_Fume_Extractor/code.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
group = displayio.Group()
5757
# adding start-up bitmap to group
5858
group.append(tile_grid)
59-
funhouse.splash.append(group)
59+
funhouse.graphics.root_group.append(group)
6060
# text for fume data
6161
fume_text = funhouse.add_text(
6262
text=" ",
@@ -74,7 +74,7 @@
7474
text_font="fonts/Arial-Bold-24.pcf",
7575
)
7676
# showing graphics
77-
funhouse.display.root_group = funhouse.splash
77+
funhouse.display.root_group = funhouse.graphics.root_group
7878

7979
# state machines
8080
run = False # state if main code is running

FunHouse_HA_Companion/code.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@
6565
)
6666

6767
# Now display the splash to draw all labels at once
68-
funhouse.display.root_group = funhouse.splash
68+
funhouse.display.root_group = funhouse.graphics.root_group
6969

7070
status = Circle(229, 10, 10, fill=0xFF0000, outline=0x880000)
71-
funhouse.splash.append(status)
71+
funhouse.graphics.root_group.append(status)
7272

7373
def connected(client, _userdata, _result, _payload):
7474
status.fill = 0x00FF00

FunHouse_LIFX/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def set_label_color(conditional, index, on_color):
7777
text=trip_time, text_scale=2, text_position=(30, 25), text_color=0x606060
7878
)
7979

80-
funhouse.display.root_group = funhouse.splash
80+
funhouse.display.root_group = funhouse.graphics.root_group
8181

8282
# Turn on the light
8383
print("Turning on light...")

FunHouse_Mailslot/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
)
3232
reset_label = funhouse.add_text(text="reset", text_position=(3, 70), text_color=GRAY)
3333

34-
funhouse.display.root_group = funhouse.splash
34+
funhouse.display.root_group = funhouse.graphics.root_group
3535

3636

3737
def send_io_data(mail_value):

FunHouse_Motion_Outlet/code.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ def timeleft():
8282
text_color=0xFFFF00,
8383
text_font="fonts/Arial-Bold-24.pcf",
8484
)
85-
funhouse.display.root_group = funhouse.splash
85+
funhouse.display.root_group = funhouse.graphics.root_group
8686

8787
status = Circle(229, 10, 10, fill=0xFF0000, outline=0x880000)
88-
funhouse.splash.append(status)
88+
funhouse.graphics.root_group.append(status)
8989

9090
# Initialize a new MQTT Client object
9191
if USE_MQTT:

FunHouse_Pet_Bowl_Sensor/code.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ def bowl_level_display(level):
7777
text_color=0xFFFF00,
7878
text_font="fonts/Arial-Bold-24.pcf",
7979
)
80-
funhouse.display.root_group = funhouse.splash
80+
funhouse.display.root_group = funhouse.graphics.root_group
8181

8282
status = Circle(229, 10, 10, fill=0xFF0000, outline=0x880000)
83-
funhouse.splash.append(status)
83+
funhouse.graphics.root_group.append(status)
8484

8585
# Initialize a new MQTT Client object
8686
funhouse.network.init_mqtt(

MagTag/MagTag_Covid_Vaccination/code.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
BAR_X, 95, BAR_WIDTH, BAR_HEIGHT, 1.0, bar_color=0x999999, outline_color=0x000000
6666
)
6767

68-
magtag.graphics.splash.append(progress_bar)
69-
magtag.graphics.splash.append(progress_bar_1)
68+
magtag.graphics.root_group.append(progress_bar)
69+
magtag.graphics.root_group.append(progress_bar_1)
7070
magtag.graphics.set_background("/bmps/background.bmp")
7171

7272

MagTag/MagTag_Flashcards/chapters/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
# Add button labels at the bottom of the screen
4242
BUTTON_TEXT_IDX = list_len
43-
magtag.graphics.splash.append(Rect(0, magtag.graphics.display.height - 14,
43+
magtag.graphics.root_group.append(Rect(0, magtag.graphics.display.height - 14,
4444
magtag.graphics.display.width,
4545
magtag.graphics.display.height, fill=0x0))
4646
magtag.add_text(

MagTag/MagTag_Google_Calendar/authenticator.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
display = graphics.display
3333

3434
background = Rect(0, 0, 296, 128, fill=0xFFFFFF)
35-
graphics.splash.append(background)
35+
graphics.root_group.append(background)
3636

3737
label_overview_text = Label(
3838
font_large,
@@ -42,18 +42,18 @@
4242
color=0x000000,
4343
text="Authorize this device with Google:",
4444
)
45-
graphics.splash.append(label_overview_text)
45+
graphics.root_group.append(label_overview_text)
4646

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

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

5353
label_qr_code = Label(
5454
font_small, x=0, y=100, color=0x000000, text="Or scan the QR code:"
5555
)
56-
graphics.splash.append(label_qr_code)
56+
graphics.root_group.append(label_qr_code)
5757

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

8787
graphics.qrcode(google_auth.verification_url.encode(), qr_size=2, x=240, y=70)
88-
graphics.display.root_group = graphics.splash
88+
graphics.display.root_group = graphics.root_group
8989
display.refresh()
9090

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

101-
graphics.splash.pop()
102-
graphics.splash.pop()
103-
graphics.splash.pop()
101+
graphics.root_group.pop()
102+
graphics.root_group.pop()
103+
graphics.root_group.pop()
104104

105105
label_overview_text.text = "Successfully Authenticated!"
106106
label_verification_url.text = (

MagTag/MagTag_Google_Calendar/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def display_calendar_events(resp_events):
205205

206206
# Add the header
207207
line_header = Line(0, 30, 320, 30, color=0x000000)
208-
magtag.splash.append(line_header)
208+
magtag.graphics.root_group.append(line_header)
209209

210210
label_header = magtag.add_text(
211211
text_font="fonts/Arial-18.pcf",

0 commit comments

Comments
 (0)