From 278ee0728afc17bda10c052dec6106a079c7af52 Mon Sep 17 00:00:00 2001 From: Paul Cutler Date: Thu, 2 Nov 2023 20:30:32 -0500 Subject: [PATCH 1/2] Update root_group for CP 9 compatibility --- examples/display_notification_eink_gizmo.py | 9 ++++----- examples/display_notification_simpletest.py | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/examples/display_notification_eink_gizmo.py b/examples/display_notification_eink_gizmo.py index 6a743f2..66cc755 100644 --- a/examples/display_notification_eink_gizmo.py +++ b/examples/display_notification_eink_gizmo.py @@ -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 @@ -77,16 +77,15 @@ def find_connection(): print(new_notification) latest_notification = new_notification screen_updated = False - display.show( - apple.create_notification_widget( + 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. diff --git a/examples/display_notification_simpletest.py b/examples/display_notification_simpletest.py index ae1738a..8850d51 100644 --- a/examples/display_notification_simpletest.py +++ b/examples/display_notification_simpletest.py @@ -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 From bda8808512be9b29737a4b975c6733c56cf2fdf1 Mon Sep 17 00:00:00 2001 From: Paul Cutler Date: Thu, 2 Nov 2023 20:35:54 -0500 Subject: [PATCH 2/2] Run black to try to pass CI --- examples/display_notification_eink_gizmo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/display_notification_eink_gizmo.py b/examples/display_notification_eink_gizmo.py index 66cc755..79c754e 100644 --- a/examples/display_notification_eink_gizmo.py +++ b/examples/display_notification_eink_gizmo.py @@ -78,8 +78,8 @@ def find_connection(): latest_notification = new_notification screen_updated = False display.root_group = apple.create_notification_widget( - latest_notification, display.width, display.height - ) + 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.