diff --git a/adafruit_esp32spi/adafruit_esp32spi_wifimanager.py b/adafruit_esp32spi/adafruit_esp32spi_wifimanager.py index 9906847..f0acae2 100755 --- a/adafruit_esp32spi/adafruit_esp32spi_wifimanager.py +++ b/adafruit_esp32spi/adafruit_esp32spi_wifimanager.py @@ -42,8 +42,9 @@ def __init__(self, esp, secrets, status_pixel=None, attempts=2): """ :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 or DotStar (default=None) - :type status_pixel: NeoPixel or DotStar + :param status_pixel: (Optional) The pixel device - A NeoPixel, DotStar, + or RGB LED (default=None) + :type status_pixel: NeoPixel, DotStar, or RGB LED :param int attempts: (Optional) Failed attempts before resetting the ESP32 (default=2) """ # Read the settings @@ -214,13 +215,16 @@ def ip_address(self): def pixel_status(self, value): """ - Change Status NeoPixel if it was defined + Change Status Pixel if it was defined :param value: The value to set the Board's status LED to :type value: int or 3-value tuple """ if self.statuspix: - self.statuspix.fill(value) + if hasattr(self.statuspix, 'color'): + self.statuspix.color = value + else: + self.statuspix.fill(value) def signal_strength(self): """ diff --git a/examples/esp32spi_aio_post.py b/examples/esp32spi_aio_post.py index bdf395c..dfbf194 100644 --- a/examples/esp32spi_aio_post.py +++ b/examples/esp32spi_aio_post.py @@ -30,7 +30,14 @@ """Use below for Most Boards""" status_light = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=0.2) # Uncomment for Most Boards """Uncomment below for ItsyBitsy M4""" -#status_light = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=0.2) +# status_light = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=0.2) +# Uncomment below for an externally defined RGB LED +# import adafruit_rgbled +# from adafruit_esp32spi import PWMOut +# RED_LED = PWMOut.PWMOut(esp, 26) +# GREEN_LED = PWMOut.PWMOut(esp, 27) +# BLUE_LED = PWMOut.PWMOut(esp, 25) +# status_light = adafruit_rgbled.RGBLED(RED_LED, BLUE_LED, GREEN_LED) wifi = adafruit_esp32spi_wifimanager.ESPSPI_WiFiManager(esp, secrets, status_light) counter = 0