Skip to content

Commit aeae91e

Browse files
author
brentru
committed
test the pixel attributes within pixel_status
1 parent d21b709 commit aeae91e

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

adafruit_esp32spi/adafruit_esp32spi_wifimanager.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ def __init__(self, esp, secrets, status_pixel=None, attempts=2):
5555
self.attempts = attempts
5656
requests.set_interface(self._esp)
5757
self.statuspix = status_pixel
58-
self._is_rgb_led = False
59-
if hasattr(self.statuspix, 'color'):
60-
self._is_rgb_led = True
6158
self.pixel_status(0)
6259

6360
def reset(self):
@@ -218,15 +215,16 @@ def ip_address(self):
218215

219216
def pixel_status(self, value):
220217
"""
221-
Change Status NeoPixel/Dotstar/RGBLED if it was defined
218+
Change Status Pixel if it was defined
222219
223220
:param value: The value to set the Board's status LED to
224221
:type value: int or 3-value tuple
225222
"""
226-
if self.statuspix and not self._is_rgb_led:
227-
self.statuspix.fill(value)
228-
else:
229-
self.statuspix.color = value
223+
if self.statuspix:
224+
if hasattr(self.statuspix, 'color'):
225+
self.statuspix.color = value
226+
else:
227+
self.statuspix.fill(value)
230228

231229
def signal_strength(self):
232230
"""

0 commit comments

Comments
 (0)