Skip to content

Commit b8fd02e

Browse files
committed
more linting
1 parent 8c4035d commit b8fd02e

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

adafruit_esp32spi/adafruit_esp32spi_server.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ def update_poll(self):
9797
if key in self._listeners:
9898
headers = parse_headers(client)
9999
body = client.read()
100-
print("headers: ", headers)
101-
print("body: ", body)
102100
self._listeners[key](headers, body, client)
103101
else:
104102
# TODO: support optional custom 404 handler?

adafruit_esp32spi/adafruit_esp32spi_socket.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def getaddrinfo(host, port, family=0, socktype=0, proto=0, flags=0):
6060
class socket:
6161
"""A simplified implementation of the Python 'socket' class, for connecting
6262
through an interface to a remote device"""
63+
# pylint: disable=too-many-arguments
6364
def __init__(self, family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None, socknum=None):
6465
if family != AF_INET:
6566
raise RuntimeError("Only AF_INET family supported")
@@ -68,6 +69,7 @@ def __init__(self, family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None, sockn
6869
self._buffer = b''
6970
self._socknum = socknum if socknum else _the_interface.get_socket()
7071
self.settimeout(0)
72+
# pylint: enable=too-many-arguments
7173

7274
def connect(self, address, conntype=None):
7375
"""Connect the socket to the 'address' (which can be 32bit packed IP or

examples/esp32spi_server.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import adafruit_esp32spi.adafruit_esp32spi_wifimanager as wifimanager
77
import adafruit_esp32spi.adafruit_esp32spi_server as server
88

9+
import neopixel
10+
911
# Get wifi details and more from a secrets.py file
1012
try:
1113
from secrets import secrets
@@ -21,14 +23,15 @@
2123
esp32_gpio0 = DigitalInOut(board.D12)
2224

2325
"""Use below for Most Boards"""
24-
# status_light = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=0.2) # Uncomment for Most Boards
26+
status_light = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=0.2) # Uncomment for Most Boards
2527
"""Uncomment below for ItsyBitsy M4"""
26-
import adafruit_dotstar as dotstar
27-
status_light = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=1)
28+
# import adafruit_dotstar as dotstar
29+
# status_light = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=1)
2830

2931

3032
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
31-
esp = adafruit_esp32spi.ESP_SPIcontrol(spi, esp32_cs, esp32_ready, esp32_reset, gpio0_pin=esp32_gpio0, debug=False)
33+
esp = adafruit_esp32spi.ESP_SPIcontrol(
34+
spi, esp32_cs, esp32_ready, esp32_reset, gpio0_pin=esp32_gpio0, debug=False)
3235

3336
## Connect to wifi with secrets
3437
wifi = wifimanager.ESPSPI_WiFiManager(esp, secrets, status_light, debug=True)
@@ -40,15 +43,22 @@
4043

4144
def onLedHigh(headers, body, client):
4245
print("led on!")
46+
print("headers: ", headers)
47+
print("body: ", body)
4348
status_light.fill((0, 0, 100))
4449
respond(headers, body, client)
4550

4651
def onLedLow(headers, body, client):
4752
print("led off!")
53+
print("headers: ", headers)
54+
print("body: ", body)
4855
status_light.fill(0)
4956
respond(headers, body, client)
5057

5158
def respond(headers, body, client):
59+
print("headers: ", headers)
60+
print("body: ", body)
61+
5262
client.write(b"HTTP/1.1 200 OK\r\n")
5363
client.write(b"Content-type:text/html\r\n")
5464
client.write(b"\r\n")

0 commit comments

Comments
 (0)