@@ -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 )
@@ -325,7 +334,7 @@ def _send_command_get_response(
325
334
* ,
326
335
reply_params = 1 ,
327
336
sent_param_len_16 = False ,
328
- recv_param_len_16 = False
337
+ recv_param_len_16 = False ,
329
338
):
330
339
"""Send a high level SPI command, wait and return the response"""
331
340
self ._send_command (cmd , params , param_len_16 = sent_param_len_16 )
@@ -573,7 +582,10 @@ def connect_AP(self, ssid, password, timeout_s=10): # pylint: disable=invalid-n
573
582
:param timeout_s: number of seconds until we time out and fail to create AP
574
583
"""
575
584
if self ._debug :
576
- print ("Connect to AP" , ssid , password )
585
+ print (
586
+ f"Connect to AP: { ssid = } , password=\
587
+ { repr (password if self ._debug_show_secrets else '*' * len (password ))} "
588
+ )
577
589
if isinstance (ssid , str ):
578
590
ssid = bytes (ssid , "utf-8" )
579
591
if password :
0 commit comments