Skip to content

Commit

Permalink
Merge pull request #49 from ch4nsuk3/expose-name-property
Browse files Browse the repository at this point in the history
Exposed Name attribute
  • Loading branch information
FoamyGuy authored Dec 4, 2024
2 parents 09e3958 + 044c03a commit 014d013
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion adafruit_button/button_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def __init__(
self._height = height
self._font = label_font
self._selected = False
self.name = name
self._name = name
self._label = label
self._label_color = _check_color(label_color)
self._label_font = label_font
Expand Down Expand Up @@ -171,3 +171,12 @@ def label_color(self) -> int:
def label_color(self, new_color: Union[int, Tuple[int, int, int]]) -> None:
self._label_color = _check_color(new_color)
self._label.color = self._label_color

@property
def name(self) -> str:
"""The name of the button"""
return self._name

@name.setter
def name(self, new_name: str) -> None:
self._name = new_name

0 comments on commit 014d013

Please sign in to comment.