@@ -86,7 +86,6 @@ class RGBLED:
86
86
import adafruit_rgbled
87
87
with adafruit_rgbled.RGBLED(board.D5, board.D6, board.D7, invert_pwm=True) as rgb_led:
88
88
rgb_led.color = (0, 255, 0)
89
-
90
89
"""
91
90
92
91
def __init__ (
@@ -135,21 +134,18 @@ def deinit(self) -> None:
135
134
136
135
@property
137
136
def color (self ) -> Union [int , tuple ]:
138
- """Return the RGB LED's current color.
139
-
140
- :return Union[int, tuple]: The currently set color.
141
137
"""
142
- return self ._current_color
143
-
144
- @color .setter
145
- def color (self , value : Union [int , tuple ]):
146
- """Sets the RGB LED to a desired color.
138
+ Sets the RGB LED to a desired color.
147
139
:param Union[int, tuple] value: RGB LED desired value - can be a RGB tuple of values
148
140
0 - 255 or a 24-bit integer. e.g. (255, 64, 35) and 0xff4023 are equivalent.
149
141
150
142
:raises ValueError: If the input is an int > 0xffffff.
151
143
:raises TypeError: If the input is not an integer or a tuple.
152
144
"""
145
+ return self ._current_color
146
+
147
+ @color .setter
148
+ def color (self , value : Union [int , tuple ]):
153
149
self ._current_color = value
154
150
if isinstance (value , tuple ):
155
151
for i in range (0 , 3 ):
0 commit comments