@@ -141,9 +141,18 @@ class ESP_SPIcontrol: # pylint: disable=too-many-public-methods, too-many-insta
141
141
142
142
# pylint: disable=too-many-arguments
143
143
def __init__ (
144
- self , spi , cs_dio , ready_dio , reset_dio , gpio0_dio = None , * , debug = False
144
+ self ,
145
+ spi ,
146
+ cs_dio ,
147
+ ready_dio ,
148
+ reset_dio ,
149
+ gpio0_dio = None ,
150
+ * ,
151
+ debug = False ,
152
+ debug_show_secrets = False ,
145
153
):
146
154
self ._debug = debug
155
+ self ._debug_show_secrets = debug_show_secrets
147
156
self .set_psk = False
148
157
self .set_crt = False
149
158
self ._buffer = bytearray (10 )
@@ -563,22 +572,19 @@ def connect(self, secrets):
563
572
that contains a 'ssid' and 'password' entry"""
564
573
self .connect_AP (secrets ["ssid" ], secrets ["password" ])
565
574
566
- def connect_AP (
567
- self , ssid , password , timeout_s = 10 , show_password = False
568
- ): # pylint: disable=invalid-name
575
+ def connect_AP (self , ssid , password , timeout_s = 10 ): # pylint: disable=invalid-name
569
576
"""Connect to an access point with given name and password.
570
577
Will wait until specified timeout seconds and return on success
571
578
or raise an exception on failure.
572
579
573
580
:param ssid: the SSID to connect to
574
581
:param passphrase: the password of the access point
575
582
:param timeout_s: number of seconds until we time out and fail to create AP
576
- :param show_password: print password if debug == True (default False)
577
583
"""
578
584
if self ._debug :
579
585
print (
580
586
f"Connect to AP: { ssid = } , password=\
581
- { repr (password if show_password else '*' * len (password ))} "
587
+ { repr (password if self . _debug_show_secrets else '*' * len (password ))} "
582
588
)
583
589
if isinstance (ssid , str ):
584
590
ssid = bytes (ssid , "utf-8" )
0 commit comments