Skip to content

Commit 3584737

Browse files
Apply suggestions from code review
Co-authored-by: Dan Halbert <[email protected]>
1 parent 5dfafb6 commit 3584737

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

adafruit_esp32spi/adafruit_esp32spi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,11 +661,11 @@ def connect(self, ssid, password=None, timeout=10):
661661
**Deprecated functionality:** If the first argument (``ssid``) is a ``dict``,
662662
assume it is a dictionary with entries for keys ``"ssid"`` and, optionally, ``"password"``.
663663
This mimics the previous signature for ``connect()``.
664-
This upward compatbility will be removed in a future release.
664+
This upward compatibility will be removed in a future release.
665665
"""
666666
if isinstance(ssid, dict): # secrets
667667
warnings.warn(
668-
"The passing in of `secrets`, is deprecated. Use connect with a `ssid` and "
668+
"The passing in of `secrets`, is deprecated. Use connect() with `ssid` and "
669669
"`password` instead and fetch values from settings.toml with `os.getenv()`."
670670
)
671671
ssid, password = ssid["ssid"], ssid.get("password")

adafruit_esp32spi/adafruit_esp32spi_wifimanager.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ def __init__(
4646
):
4747
"""
4848
:param ESP_SPIcontrol esp: The ESP object we are using
49-
:param str ssid: the SSID of the created Access Point. Must be less than 32 chars.
50-
:param str password: the password of the created Access Point. Must be 8-63 chars.
51-
:param str enterprise_ident: the ident when connecting to an enterprise Access Point.
52-
:param str enterprise_user: the user when connecting to an enterprise Access Point.
49+
:param str ssid: the SSID of the access point. Must be less than 32 chars.
50+
:param str password: the password for the access point. Must be 8-63 chars.
51+
:param str enterprise_ident: the ident to use when connecting to an enterprise access point.
52+
:param str enterprise_user: the username to use when connecting to an enterprise access point.
5353
:param status_pixel: (Optional) The pixel device - A NeoPixel, DotStar,
5454
or RGB LED (default=None). The status LED, if given, turns red when
5555
attempting to connect to a Wi-Fi network or create an access point,
@@ -374,7 +374,7 @@ def __init__(
374374
"""
375375
:param ESP_SPIcontrol esp: The ESP object we are using
376376
:param dict secrets: The WiFi secrets dict
377-
The use of secrets.py to populate the secrets dict is depreciated
377+
The use of secrets.py to populate the secrets dict is deprecated
378378
in favor of using settings.toml.
379379
:param status_pixel: (Optional) The pixel device - A NeoPixel, DotStar,
380380
or RGB LED (default=None). The status LED, if given, turns red when
@@ -392,16 +392,12 @@ def __init__(
392392
"fetch values from settings.toml with `os.getenv()`."
393393
)
394394

395-
ssid = secrets.get("ssid")
396-
password = secrets.get("secrets", None)
397-
enterprise_ident = secrets.get("ent_ident", "")
398-
enterprise_user = secrets.get("ent_user")
399395
super().__init__(
400396
esp=esp,
401-
ssid=ssid,
402-
password=password,
403-
enterprise_ident=enterprise_ident,
404-
enterprise_user=enterprise_user,
397+
ssid=secrets.get("ssid"),
398+
password=secrets.get("secrets"),
399+
enterprise_ident=secrets.get("ent_ident", ""),
400+
enterprise_user=secrets.get("ent_user"),
405401
status_pixel=status_pixel,
406402
attempts=attempts,
407403
connection_type=connection_type,

0 commit comments

Comments
 (0)