Skip to content

Commit 4ead3aa

Browse files
committed
add group property for backward compatibility with warning
1 parent 6842af4 commit 4ead3aa

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

adafruit_button.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,16 @@ def selected(self, value):
229229
if self._label is not None:
230230
self._label.color = new_label
231231

232+
@property
233+
def group(self):
234+
"""Return self for compatibility with old API."""
235+
print(
236+
"Warning: The group property is being deprecated. "
237+
"User code should be updated to add the Button directly to the "
238+
"Display or other Groups."
239+
)
240+
return self
241+
232242
def contains(self, point):
233243
"""Used to determine if a point is contained within a button. For example,
234244
``button.contains(touch)`` where ``touch`` is the touch point on the screen will allow for

0 commit comments

Comments
 (0)