File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,9 @@ class ESP32S2TFT(PortalBase):
63
63
portrait/rotated
64
64
:param scale: Default scale is 1, but can be an integer of 1 or greater
65
65
:param debug: Turn on debug print outs. Defaults to False.
66
+ :param use_network: Enable network initialization. Defaults to True.
67
+ Setting to False will allow you to use the library without a secrets.py
68
+ file with wifi configuration in it.
66
69
67
70
"""
68
71
@@ -80,13 +83,17 @@ def __init__(
80
83
rotation : int = 0 ,
81
84
scale : int = 1 ,
82
85
debug : bool = False ,
86
+ use_network : bool = True
83
87
) -> None :
84
88
85
- network = Network (
86
- status_neopixel = status_neopixel ,
87
- extract_values = False ,
88
- debug = debug ,
89
- )
89
+ if use_network :
90
+ network = Network (
91
+ status_neopixel = status_neopixel ,
92
+ extract_values = False ,
93
+ debug = debug ,
94
+ )
95
+ else :
96
+ network = None
90
97
91
98
graphics = Graphics (
92
99
default_bg = default_bg ,
Original file line number Diff line number Diff line change 7
7
from rainbowio import colorwheel
8
8
from adafruit_esp32s2tft import ESP32S2TFT
9
9
10
- esp32s2tft = ESP32S2TFT (
11
- default_bg = 0xFFFF00 ,
12
- scale = 2 ,
13
- )
10
+ esp32s2tft = ESP32S2TFT (default_bg = 0xFFFF00 , scale = 2 , use_network = False )
14
11
15
12
# Create the labels
16
13
esp32s2tft .add_text (
You can’t perform that action at this time.
0 commit comments