@@ -42,8 +42,9 @@ def __init__(self, esp, secrets, status_pixel=None, attempts=2):
42
42
"""
43
43
:param ESP_SPIcontrol esp: The ESP object we are using
44
44
:param dict secrets: The WiFi and Adafruit IO secrets dict (See examples)
45
- :param status_pixel: (Optional) The pixel device - A NeoPixel or DotStar (default=None)
46
- :type status_pixel: NeoPixel or DotStar
45
+ :param status_pixel: (Optional) The pixel device - A NeoPixel, DotStar,
46
+ or RGB LED (default=None)
47
+ :type status_pixel: NeoPixel, DotStar, or RGB LED
47
48
:param int attempts: (Optional) Failed attempts before resetting the ESP32 (default=2)
48
49
"""
49
50
# Read the settings
@@ -54,6 +55,9 @@ def __init__(self, esp, secrets, status_pixel=None, attempts=2):
54
55
self .attempts = attempts
55
56
requests .set_interface (self ._esp )
56
57
self .statuspix = status_pixel
58
+ self ._is_rgb_led = False
59
+ if hasattr (self .statuspix , 'color' ):
60
+ self ._is_rgb_led = True
57
61
self .pixel_status (0 )
58
62
59
63
def reset (self ):
@@ -214,13 +218,15 @@ def ip_address(self):
214
218
215
219
def pixel_status (self , value ):
216
220
"""
217
- Change Status NeoPixel if it was defined
221
+ Change Status NeoPixel/Dotstar/RGBLED if it was defined
218
222
219
223
:param value: The value to set the Board's status LED to
220
224
:type value: int or 3-value tuple
221
225
"""
222
- if self .statuspix :
226
+ if self .statuspix and not self . _is_rgb_led :
223
227
self .statuspix .fill (value )
228
+ else :
229
+ self .statuspix .color = value
224
230
225
231
def signal_strength (self ):
226
232
"""
0 commit comments