Skip to content

Commit e15ea00

Browse files
authored
Merge pull request #61 from prcutler/root-group-fix
Update to use root_group for CP 9 compatibility
2 parents e0bfd1e + 31ad24f commit e15ea00

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

adafruit_clue.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
import audiopwmio
6060
import audiocore
6161
import touchio
62+
import displayio
6263

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

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

151151
def show(self):
152152
"""Call show() to display the data list."""
153-
self._display.show(self.text_group)
153+
self._display.root_group = self.text_group
154154

155155
def show_terminal(self):
156156
"""Revert to terminalio screen."""
157-
self._display.show(None)
157+
self._display.root_group = displayio.CIRCUITPYTHON_TERMINAL
158158

159159

160160
class Clue: # pylint: disable=too-many-instance-attributes, too-many-public-methods

examples/clue_ams_remote_advanced.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
volume_inner = Rect(15, 170, 1, 20, fill=0xFFFFFF, outline=0xFFFFFF)
8585
group.append(volume_inner)
8686

87-
display.show(group)
87+
display.root_group = group
8888
time.sleep(0.01)
8989

9090
width1 = 1

examples/clue_ble_color_patchwork.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def change_advertisement(color):
207207
group.append(patchwork_group)
208208

209209
# Add the Group to the Display
210-
display.show(group)
210+
display.root_group = group
211211

212212
cur_color = 0
213213

examples/clue_spirit_level.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
bubble_group.append(level_bubble)
2424

2525
clue_group.append(bubble_group)
26-
display.show(clue_group)
26+
display.root_group = clue_group
2727

2828
while True:
2929
x, y, _ = clue.acceleration

0 commit comments

Comments
 (0)