From 3f9f4a7e5a3c9712cd71d5c9a58f0e19f14cce32 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Mon, 18 Apr 2022 11:24:08 -0500 Subject: [PATCH 1/2] optional argument to specify not using network --- adafruit_esp32s2tft/__init__.py | 14 +++++++++----- examples/esp32s2tft_simpletest.py | 5 +---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/adafruit_esp32s2tft/__init__.py b/adafruit_esp32s2tft/__init__.py index 2374872..cc569de 100755 --- a/adafruit_esp32s2tft/__init__.py +++ b/adafruit_esp32s2tft/__init__.py @@ -80,13 +80,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, diff --git a/examples/esp32s2tft_simpletest.py b/examples/esp32s2tft_simpletest.py index 8b10f74..29a3f68 100644 --- a/examples/esp32s2tft_simpletest.py +++ b/examples/esp32s2tft_simpletest.py @@ -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( From ece1abe7a1d5175ead4d563243b6ad1688fe9b22 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Tue, 10 May 2022 18:21:49 -0500 Subject: [PATCH 2/2] docstring for new argument --- adafruit_esp32s2tft/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/adafruit_esp32s2tft/__init__.py b/adafruit_esp32s2tft/__init__.py index cc569de..f99655c 100755 --- a/adafruit_esp32s2tft/__init__.py +++ b/adafruit_esp32s2tft/__init__.py @@ -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. """