Skip to content

Commit

Permalink
Merge pull request #16 from prcutler/root-group-fix
Browse files Browse the repository at this point in the history
Update root_group for CP 9 compatibility
  • Loading branch information
dhalbert authored Nov 3, 2023
2 parents 01b5726 + bda8808 commit 3de4dea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
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

0 comments on commit 3de4dea

Please sign in to comment.