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 to use root_group for CP 9 compatibility #61

Merged
merged 4 commits into from
Jan 8, 2024
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
6 changes: 3 additions & 3 deletions adafruit_clue.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
import audiopwmio
import audiocore
import touchio
import displayio

__version__ = "0.0.0+auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_CLUE.git"
Expand All @@ -77,7 +78,6 @@ def __init__( # pylint: disable=too-many-arguments
colors: Optional[Tuple[Tuple[int, int, int], ...]] = None,
):
# pylint: disable=import-outside-toplevel
import displayio
import terminalio
from adafruit_display_text import label

Expand Down Expand Up @@ -150,11 +150,11 @@ def add_text_line(self, color: Union[int, Tuple[int, int, int]] = 0xFFFFFF):

def show(self):
"""Call show() to display the data list."""
self._display.show(self.text_group)
self._display.root_group = self.text_group

def show_terminal(self):
"""Revert to terminalio screen."""
self._display.show(None)
self._display.root_group = displayio.CIRCUITPYTHON_TERMINAL


class Clue: # pylint: disable=too-many-instance-attributes, too-many-public-methods
Expand Down
2 changes: 1 addition & 1 deletion examples/clue_ams_remote_advanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
volume_inner = Rect(15, 170, 1, 20, fill=0xFFFFFF, outline=0xFFFFFF)
group.append(volume_inner)

display.show(group)
display.root_group = group
time.sleep(0.01)

width1 = 1
Expand Down
2 changes: 1 addition & 1 deletion examples/clue_ble_color_patchwork.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def change_advertisement(color):
group.append(patchwork_group)

# Add the Group to the Display
display.show(group)
display.root_group = group

cur_color = 0

Expand Down
2 changes: 1 addition & 1 deletion examples/clue_spirit_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
bubble_group.append(level_bubble)

clue_group.append(bubble_group)
display.show(clue_group)
display.root_group = clue_group

while True:
x, y, _ = clue.acceleration
Expand Down