Skip to content

Commit 5931c1b

Browse files
committed
merged conflicts
1 parent 0c07ceb commit 5931c1b

File tree

1 file changed

+9
-20
lines changed

1 file changed

+9
-20
lines changed

adafruit_esp32spi/adafruit_esp32spi_wifimanager.py

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,6 @@
3636
from adafruit_esp32spi import adafruit_esp32spi
3737
import adafruit_esp32spi.adafruit_esp32spi_requests as requests
3838

39-
class WiFiConnType: # pylint: disable=too-few-public-methods
40-
"""An enum-like class representing the different types of WiFi connections
41-
that can be made. The values can be referenced like ``WiFiConnType.normal``.
42-
Possible values are
43-
- ``ThermocoupleType.normal``
44-
- ``ThermocoupleType.enterprise``
45-
"""
46-
# pylint: disable=invalid-name
47-
normal = 1
48-
enterprise = 2
49-
5039
class ESPSPI_WiFiManager:
5140
"""
5241
A class to help manage the Wifi connection
@@ -75,7 +64,7 @@ def __init__(self, esp, secrets, status_pixel=None, attempts=2, connection_type=
7564
self.ent_ssid = secrets['ent_ssid']
7665
self.ent_ident = secrets['ent_ident']
7766
self.ent_user = secrets['ent_user']
78-
self.ent_passwd = secrets['ent_passwd']
67+
self.ent_password = secrets['ent_password']
7968
self.attempts = attempts
8069
self._connection_type = connection_type
8170
requests.set_interface(self.esp)
@@ -128,12 +117,12 @@ def connect_normal(self):
128117
Attempt a regular style WiFi connection
129118
"""
130119
failure_count = 0
131-
while not self.esp.is_connected:
120+
while not self._esp.is_connected:
132121
try:
133122
if self.debug:
134123
print("Connecting to AP...")
135124
self.pixel_status((100, 0, 0))
136-
self.esp.connect_AP(bytes(self.ssid, 'utf-8'), bytes(self.password, 'utf-8'))
125+
self._esp.connect_AP(bytes(self.ssid, 'utf-8'), bytes(self.password, 'utf-8'))
137126
failure_count = 0
138127
self.pixel_status((0, 100, 0))
139128
except (ValueError, RuntimeError) as error:
@@ -149,12 +138,12 @@ def connect_enterprise(self):
149138
Attempt an enterprise style WiFi connection
150139
"""
151140
failure_count = 0
152-
self.esp.wifi_set_network(bytes(self.ent_ssid, 'utf-8'))
153-
self.esp.wifi_set_entidentity(bytes(self.ent_ident, 'utf-8'))
154-
self.esp.wifi_set_entusername(bytes(self.ent_user, 'utf-8'))
155-
self.esp.wifi_set_entpassword(bytes(self.ent_password, 'utf-8'))
156-
self.esp.wifi_set_entenable()
157-
while not self.esp.is_connected:
141+
self._esp.wifi_set_network(bytes(self.ent_ssid, 'utf-8'))
142+
self._esp.wifi_set_entidentity(bytes(self.ent_ident, 'utf-8'))
143+
self._esp.wifi_set_entusername(bytes(self.ent_user, 'utf-8'))
144+
self._esp.wifi_set_entpassword(bytes(self.ent_password, 'utf-8'))
145+
self._esp.wifi_set_entenable()
146+
while not self._esp.is_connected:
158147
try:
159148
if self.debug:
160149
print("Waiting for the ESP32 to connect to the WPA2 Enterprise AP...")

0 commit comments

Comments
 (0)