Skip to content

Add documentation for status LED #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions adafruit_esp32spi/adafruit_esp32spi_wifimanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ def __init__(
:param ESP_SPIcontrol esp: The ESP object we are using
:param dict secrets: The WiFi and Adafruit IO secrets dict (See examples)
:param status_pixel: (Optional) The pixel device - A NeoPixel, DotStar,
or RGB LED (default=None)
or RGB LED (default=None). The status LED, if given, turns red when
attempting to connect to a Wi-Fi network or create an access point,
turning green upon success. Additionally, if given, it will turn blue
when attempting an HTTP method or returning IP address, turning off
upon success.
:type status_pixel: NeoPixel, DotStar, or RGB LED
:param int attempts: (Optional) Failed attempts before resetting the ESP32 (default=2)
:param const connection_type: (Optional) Type of WiFi connection: NORMAL or ENTERPRISE
Expand Down Expand Up @@ -128,7 +132,7 @@ def _get_next_ap(self):

def connect_normal(self):
"""
Attempt a regular style WiFi connection
Attempt a regular style WiFi connection.
"""
failure_count = 0
(ssid, password) = self._get_next_ap()
Expand Down Expand Up @@ -242,6 +246,7 @@ def post(self, url, **kw):
self.connect()
self.pixel_status((0, 0, 100))
return_val = requests.post(url, **kw)
self.pixel_status(0)
return return_val

def put(self, url, **kw):
Expand Down