Skip to content
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
17 changes: 12 additions & 5 deletions adafruit_esp32s2tft/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ class ESP32S2TFT(PortalBase):
portrait/rotated
:param scale: Default scale is 1, but can be an integer of 1 or greater
:param debug: Turn on debug print outs. Defaults to False.
:param use_network: Enable network initialization. Defaults to True.
Setting to False will allow you to use the library without a secrets.py
file with wifi configuration in it.

"""

Expand All @@ -80,13 +83,17 @@ def __init__(
rotation: int = 0,
scale: int = 1,
debug: bool = False,
use_network: bool = True
) -> None:

network = Network(
status_neopixel=status_neopixel,
extract_values=False,
debug=debug,
)
if use_network:
network = Network(
status_neopixel=status_neopixel,
extract_values=False,
debug=debug,
)
else:
network = None

graphics = Graphics(
default_bg=default_bg,
Expand Down
5 changes: 1 addition & 4 deletions examples/esp32s2tft_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
from rainbowio import colorwheel
from adafruit_esp32s2tft import ESP32S2TFT

esp32s2tft = ESP32S2TFT(
default_bg=0xFFFF00,
scale=2,
)
esp32s2tft = ESP32S2TFT(default_bg=0xFFFF00, scale=2, use_network=False)

# Create the labels
esp32s2tft.add_text(
Expand Down