Skip to content

Commit

Permalink
Merge pull request #122 from anecdata/disconnect
Browse files Browse the repository at this point in the history
Expose NINA disconnect
  • Loading branch information
tannewt authored Jan 5, 2021
2 parents fce466b + ba68b3e commit 6f2e0ff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions adafruit_esp32spi/adafruit_esp32spi.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,12 @@ def ap_listening(self):
self.reset()
return False

def disconnect(self):
"""Disconnect from the access point"""
resp = self._send_command_get_response(_DISCONNECT_CMD)
if resp[0][0] != 1:
raise RuntimeError("Failed to disconnect")

def connect(self, secrets):
"""Connect to an access point using a secrets dictionary
that contains a 'ssid' and 'password' entry"""
Expand Down

0 comments on commit 6f2e0ff

Please sign in to comment.