@@ -372,12 +372,12 @@ def MAC_address(self): # pylint: disable=invalid-name
372
372
@property
373
373
def MAC_address_actual (self ): # pylint: disable=invalid-name
374
374
"""A bytearray containing the actual MAC address of the ESP32"""
375
- if self ._debug :
376
- print ( "MAC address" )
377
- resp = self . _send_command_get_response ( _GET_MACADDR_CMD , [ b" \xFF " ])
378
- new_resp = bytearray ( resp [ 0 ])
379
- new_resp = reversed ( new_resp )
380
- return new_resp
375
+ return bytearray ( reversed ( self .MAC_address ))
376
+
377
+ @ property
378
+ def mac_address ( self ):
379
+ """A bytes containing the actual MAC address of the ESP32"""
380
+ return bytes ( reversed ( self . MAC_address ))
381
381
382
382
def start_scan_networks (self ):
383
383
"""Begin a scan of visible access points. Follow up with a call
@@ -573,8 +573,10 @@ def disconnect(self):
573
573
if resp [0 ][0 ] != 1 :
574
574
raise OSError ("Failed to disconnect" )
575
575
576
- def connect (self , ssid , password , timeout = 10 ):
576
+ def connect (self , ssid , password = None , timeout = 10 ):
577
577
"""Connect to an access point with given name and password."""
578
+ if isinstance (ssid , dict ): # secrets
579
+ ssid , password = ssid ["ssid" ], ssid ["password" ]
578
580
self .connect_AP (ssid , password , timeout_s = timeout )
579
581
580
582
def connect_AP (self , ssid , password , timeout_s = 10 ): # pylint: disable=invalid-name
0 commit comments