Skip to content

Commit 447955a

Browse files
committed
merged conflicts
1 parent cbc7901 commit 447955a

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

adafruit_esp32spi/adafruit_esp32spi_wifimanager.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ def __init__(self, esp, secrets, status_pixel=None, attempts=2, connection_type=
6161
self.debug = False
6262
self.ssid = secrets['ssid']
6363
self.password = secrets['password']
64+
self.ent_ssid = secrets['ent_ssid']
65+
self.ent_ident = secrets['ent_ident']
66+
self.ent_user = secrets['ent_user']
67+
self.ent_passwd = secrets['ent_passwd']
6468
self.attempts = attempts
6569
self._connection_type = connection_type
6670
requests.set_interface(self.esp)
@@ -113,12 +117,12 @@ def connect_normal(self):
113117
Attempt a regular style WiFi connection
114118
"""
115119
failure_count = 0
116-
while not self.esp.is_connected:
120+
while not self._esp.is_connected:
117121
try:
118122
if self.debug:
119123
print("Connecting to AP...")
120124
self.pixel_status((100, 0, 0))
121-
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'))
122126
failure_count = 0
123127
self.pixel_status((0, 100, 0))
124128
except (ValueError, RuntimeError) as error:
@@ -134,12 +138,12 @@ def connect_enterprise(self):
134138
Attempt an enterprise style WiFi connection
135139
"""
136140
failure_count = 0
137-
self.esp.wifi_set_network(bytes(self.ent_ssid, 'utf-8'))
138-
self.esp.wifi_set_entidentity(bytes(self.ent_ident, 'utf-8'))
139-
self.esp.wifi_set_entusername(bytes(self.ent_user, 'utf-8'))
140-
self.esp.wifi_set_entpassword(bytes(self.ent_password, 'utf-8'))
141-
self.esp.wifi_set_entenable()
142-
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:
143147
try:
144148
if self.debug:
145149
print("Waiting for the ESP32 to connect to the WPA2 Enterprise AP...")

0 commit comments

Comments
 (0)