Skip to content

Commit 0a6ba00

Browse files
committed
allow shorter imports; update examples to match
1 parent 7682421 commit 0a6ba00

14 files changed

+51
-18
lines changed

adafruit_esp32spi/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 Dan Halbert for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
# Allow
6+
# import adafruit_esp32spi
7+
# from adafruit_esp32spi.ESP_SPIcontrol
8+
# etc.
9+
# instead of the more verbose
10+
# import adafruit_esp32pi.adafruit_esp32spi
11+
# etc.
12+
13+
from .adafruit_esp32spi import *

adafruit_esp32spi/socketpool.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 Dan Halbert for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
# Allow
6+
# from adafruit_esp32pi.socketpool import SocketPool
7+
# instead of the more verbose
8+
# from adafruit_esp32pi.adafruit_esp32spi_socketpool import SocketPool
9+
10+
from .adafruit_esp32spi_socketpool import *

adafruit_esp32spi/wifimanager.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 Dan Halbert for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
# Allow imports like
6+
# from adafruit_esp32pi.wifimanager import WiFiManager
7+
# instead of the more verbose
8+
# from adafruit_esp32pi.adafruit_esp32spi_wifimanager import WiFiManager
9+
10+
from .adafruit_esp32spi_wifimanager import *

examples/esp32spi_aio_post.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
import neopixel
1010
from digitalio import DigitalInOut
1111

12-
from adafruit_esp32spi import adafruit_esp32spi
13-
from adafruit_esp32spi.adafruit_esp32spi_wifimanager import WiFiManager
12+
import adafruit_esp32spi
13+
from adafruit_esp32spi.wifimanager import WiFiManager
1414

1515
print("ESP32 SPI webclient test")
1616

examples/esp32spi_cheerlights.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
import neopixel
1111
from digitalio import DigitalInOut
1212

13-
from adafruit_esp32spi import adafruit_esp32spi
14-
from adafruit_esp32spi.adafruit_esp32spi_wifimanager import WiFiManager
13+
import adafruit_esp32spi
14+
from adafruit_esp32spi.wifimanager import WiFiManager
1515

1616
# Get wifi details and more from a settings.toml file
1717
# tokens used by this Demo: CIRCUITPY_WIFI_SSID, CIRCUITPY_WIFI_PASSWORD

examples/esp32spi_ipconfig.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import busio
99
from digitalio import DigitalInOut
1010

11-
import adafruit_esp32spi.adafruit_esp32spi_socketpool as socketpool
12-
from adafruit_esp32spi import adafruit_esp32spi
11+
import adafruit_esp32spi
12+
from adafruit_esp32spi import socketpool
1313

1414
# Get wifi details and more from a settings.toml file
1515
# tokens used by this Demo: CIRCUITPY_WIFI_SSID, CIRCUITPY_WIFI_PASSWORD

examples/esp32spi_localtime.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
import rtc
1111
from digitalio import DigitalInOut
1212

13-
from adafruit_esp32spi import adafruit_esp32spi
14-
from adafruit_esp32spi.adafruit_esp32spi_wifimanager import WiFiManager
13+
adafruit_esp32spi
14+
from adafruit_esp32spi.wifimanager import WiFiManager
1515

1616
# Get wifi details and more from a settings.toml file
1717
# tokens used by this Demo: CIRCUITPY_WIFI_SSID, CIRCUITPY_WIFI_PASSWORD

examples/esp32spi_simpletest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import busio
1010
from digitalio import DigitalInOut
1111

12-
from adafruit_esp32spi import adafruit_esp32spi
12+
import adafruit_esp32spi
1313

1414
# Get wifi details and more from a settings.toml file
1515
# tokens used by this Demo: CIRCUITPY_WIFI_SSID, CIRCUITPY_WIFI_PASSWORD

examples/esp32spi_simpletest_rp2040.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import busio
1010
from digitalio import DigitalInOut
1111

12-
from adafruit_esp32spi import adafruit_esp32spi
12+
import adafruit_esp32spi
1313

1414
# Get wifi details and more from a settings.toml file
1515
# tokens used by this Demo: CIRCUITPY_WIFI_SSID, CIRCUITPY_WIFI_PASSWORD

examples/esp32spi_tcp_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import busio
88
from digitalio import DigitalInOut
99

10-
import adafruit_esp32spi.adafruit_esp32spi_socketpool as socketpool
11-
from adafruit_esp32spi import adafruit_esp32spi
10+
import adafruit_esp32spi
11+
from adafruit_esp32spi import socketpool
1212

1313
# Get wifi details and more from a settings.toml file
1414
# tokens used by this Demo: CIRCUITPY_WIFI_SSID, CIRCUITPY_WIFI_PASSWORD

0 commit comments

Comments
 (0)