Skip to content

Commit cf6ffd5

Browse files
authored
PyPortal_TOTOP_Friend: update to settings.toml
1 parent 52abcb8 commit cf6ffd5

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • PyPortal/PyPortal_TOTP_Friend

PyPortal/PyPortal_TOTP_Friend/code.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@
3535
# How long to stay on if not in always_on mode
3636
ON_SECONDS = 60
3737

38-
# Get wifi details and more from a secrets.py file
38+
# Get totp keys from a secrets.py file
3939
try:
4040
from secrets import secrets
4141
except ImportError:
42-
print("WiFi secrets are kept in secrets.py, please add them there!")
42+
print("TOTP keys are kept in secrets.py, please add them there!")
4343
raise
4444

4545
# Initialize PyPortal Display
@@ -200,12 +200,12 @@ def display_otp_key(secret_name, secret_otp):
200200
print("Connecting to AP...")
201201
while not esp.is_connected:
202202
try:
203-
esp.connect_AP(secrets['ssid'], secrets['password'])
203+
esp.connect_AP(os.getenv("CIRCUITPY_WIFI_SSID"), os.getenv("CIRCUITPY_WIFI_PASSWORD"))
204204
except RuntimeError as e:
205205
print("Could not connect to AP, retrying: ", e)
206206
continue
207207

208-
print("Connected to ", secrets['ssid'])
208+
print("Connected")
209209

210210
# get_time will raise ValueError if the time isn't available yet so loop until
211211
# it works.

0 commit comments

Comments
 (0)