Skip to content

Commit

Permalink
Merge pull request #130 from dhalbert/no-show
Browse files Browse the repository at this point in the history
replace .show with .root_group =
  • Loading branch information
dhalbert authored Nov 3, 2023
2 parents a14d41b + 8f9403f commit 5302ba8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions adafruit_pyportal/graphics.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def qrcode(self, qr_data, *, qr_size=1, x=0, y=0, hide_background=False):
y=y,
)
if hide_background:
self.display.show(self._qr_group)
self.display.root_group = self._qr_group
self._qr_only = hide_background

# pylint: enable=arguments-differ
Expand All @@ -71,7 +71,7 @@ def hide_QR(self): # pylint: disable=invalid-name
"""Clear any QR codes that are currently on the screen"""

if self._qr_only:
self.display.show(self.splash)
self.display.root_group = self.splash
else:
try:
self._qr_group.pop()
Expand Down
4 changes: 3 additions & 1 deletion examples/pyportal_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@
# NOTE: Make sure you've created your secrets.py file before running this example
# https://learn.adafruit.com/adafruit-pyportal/internet-connect#whats-a-secrets-file-17-2
import board
from displayio import CIRCUITPYTHON_TERMINAL
from adafruit_pyportal import PyPortal


# Set a data source URL
TEXT_URL = "http://wifitest.adafruit.com/testwifi/index.html"

# Create the PyPortal object
pyportal = PyPortal(url=TEXT_URL, status_neopixel=board.NEOPIXEL)

# Set display to show REPL
board.DISPLAY.show(None)
board.DISPLAY.root_group = CIRCUITPYTHON_TERMINAL

# Go get that data
print("Fetching text from", TEXT_URL)
Expand Down

0 comments on commit 5302ba8

Please sign in to comment.