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):
6363 portrait/rotated
6464 :param scale: Default scale is 1, but can be an integer of 1 or greater
6565 :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.
6669
6770 """
6871
@@ -80,13 +83,17 @@ def __init__(
8083 rotation : int = 0 ,
8184 scale : int = 1 ,
8285 debug : bool = False ,
86+ use_network : bool = True
8387 ) -> None :
8488
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
9097
9198 graphics = Graphics (
9299 default_bg = default_bg ,
Original file line number Diff line number Diff line change 77from rainbowio import colorwheel
88from 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
1613esp32s2tft .add_text (
You can’t perform that action at this time.
0 commit comments