Skip to content

Commit d3db360

Browse files
committed
pylint fixes
1 parent ecf0694 commit d3db360

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

adafruit_espatcontrol.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def begin(self):
147147
except OKError:
148148
pass #retry
149149

150-
def request_url(self, url, ssl=False, type = "GET"):
150+
def request_url(self, url, ssl=False, request_type="GET"):
151151
"""Send an HTTP request to the URL. If the URL starts with https://
152152
we will force SSL and use port 443. Otherwise, you can select whether
153153
you want ssl by passing in a flag."""
@@ -165,7 +165,7 @@ def request_url(self, url, ssl=False, type = "GET"):
165165
port = 443
166166
if not self.socket_connect(conntype, domain, port, keepalive=10, retries=3):
167167
raise RuntimeError("Failed to connect to host")
168-
request = type+" "+path+" HTTP/1.1\r\n"
168+
request = request_type+" "+path+" HTTP/1.1\r\n"
169169
request += "Host: "+domain+"\r\n"
170170
request += "User-Agent: "+self.USER_AGENT+"\r\n"
171171
request += "\r\n"

examples/espatcontrol_post.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@
2424

2525
print("Post to a URL", URL)
2626

27-
esp = adafruit_espatcontrol.ESP_ATcontrol(uart, 115200, reset_pin=resetpin, run_baudrate = 115200, rts_pin=rtspin, debug=True)
27+
esp = adafruit_espatcontrol.ESP_ATcontrol(uart, 115200, reset_pin=resetpin,
28+
run_baudrate = 115200, rts_pin=rtspin, debug=True)
2829
print("Resetting ESP module")
2930
esp.hard_reset()
3031
print("Connected to AT software version", esp.get_version())
3132

32-
counter = 0
33+
counter = 0
3334
while True:
3435
try:
3536
# Connect to WiFi if not already
@@ -39,7 +40,7 @@
3940
print("Connected to", esp.remote_AP)
4041
# great, lets get the data
4142
print("Posting request URL...", end='')
42-
header, body = esp.request_url(URL+str(counter), type = "POST")
43+
header, body = esp.request_url(URL+str(counter), request_type = "POST")
4344
counter = counter + 1
4445
print("OK")
4546
except (RuntimeError, adafruit_espatcontrol.OKError) as e:

0 commit comments

Comments
 (0)