Skip to content
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

Update root_group for CP 9 compatibility #16

Merged
merged 2 commits into from
Nov 3, 2023
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
11 changes: 5 additions & 6 deletions examples/display_notification_eink_gizmo.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def find_connection():
display = eink_gizmo.EInk_Gizmo()

radio_widget = AdvertisingWidget(radio.name, display.width, display.height)
display.show(radio_widget)
display.root_group = radio_widget

# True when the screen reflects our current state.
screen_updated = False
Expand Down Expand Up @@ -77,16 +77,15 @@ def find_connection():
print(new_notification)
latest_notification = new_notification
screen_updated = False
display.show(
apple.create_notification_widget(
latest_notification, display.width, display.height
)
display.root_group = apple.create_notification_widget(
latest_notification, display.width, display.height
)

elif latest_notification and latest_notification.removed:
# Stop showing the latest and show that there are no new notifications.
latest_notification = None
screen_updated = False
display.show(NotificationFree(display.width, display.height))
display.root_group = NotificationFree(display.width, display.height)

# Do not refresh the screen more often than every 180 seconds for eInk displays! Rapid
# refreshes will damage the panel.
Expand Down
2 changes: 1 addition & 1 deletion examples/display_notification_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def find_connection():

display = tft_gizmo.TFT_Gizmo()
group = displayio.Group(scale=SCALE)
display.show(group)
display.root_group = group

width = display.width // SCALE
height = display.height // SCALE
Expand Down