Skip to content

Commit 3f9f4a7

Browse files
committed
optional argument to specify not using network
1 parent 760411b commit 3f9f4a7

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

adafruit_esp32s2tft/__init__.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,17 @@ def __init__(
8080
rotation: int = 0,
8181
scale: int = 1,
8282
debug: bool = False,
83+
use_network: bool = True
8384
) -> None:
8485

85-
network = Network(
86-
status_neopixel=status_neopixel,
87-
extract_values=False,
88-
debug=debug,
89-
)
86+
if use_network:
87+
network = Network(
88+
status_neopixel=status_neopixel,
89+
extract_values=False,
90+
debug=debug,
91+
)
92+
else:
93+
network = None
9094

9195
graphics = Graphics(
9296
default_bg=default_bg,

examples/esp32s2tft_simpletest.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
from rainbowio import colorwheel
88
from adafruit_esp32s2tft import ESP32S2TFT
99

10-
esp32s2tft = ESP32S2TFT(
11-
default_bg=0xFFFF00,
12-
scale=2,
13-
)
10+
esp32s2tft = ESP32S2TFT(default_bg=0xFFFF00, scale=2, use_network=False)
1411

1512
# Create the labels
1613
esp32s2tft.add_text(

0 commit comments

Comments
 (0)