File tree Expand file tree Collapse file tree
PyPortal/PyPortal_TOTP_Friend Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3535# How long to stay on if not in always_on mode
3636ON_SECONDS = 60
3737
38- # Get wifi details and more from a secrets.py file
38+ # Get totp keys from a secrets.py file
3939try :
4040 from secrets import secrets
4141except 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):
200200print ("Connecting to AP..." )
201201while 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.
You can’t perform that action at this time.
0 commit comments