Skip to content

Commit

Permalink
Merge pull request #61 from prcutler/root-group-fix
Browse files Browse the repository at this point in the history
Update to use root_group for CP 9 compatibility
  • Loading branch information
FoamyGuy authored Jan 8, 2024
2 parents e0bfd1e + 31ad24f commit e15ea00
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
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

0 comments on commit e15ea00

Please sign in to comment.