Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions adafruit_display_text/scrolling_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def update(self, force: bool = False) -> None:
if force or self._last_animate_time + self.animate_time <= _now:

if len(self.full_text) <= self.max_characters:
self.text = self.full_text
super()._set_text(self.full_text, self.scale)
self._last_animate_time = _now
return

Expand All @@ -106,8 +106,7 @@ def update(self, force: bool = False) -> None:
_showing_string = "{}{}".format(
_showing_string_start, _showing_string_end
)
self.text = _showing_string

super()._set_text(_showing_string, self.scale)
self.current_index += 1
self._last_animate_time = _now

Expand Down Expand Up @@ -144,3 +143,16 @@ def full_text(self, new_text: str) -> None:
self._full_text = new_text
self.current_index = 0
self.update()

@property
def text(self):
"""The full text to be shown. If it's longer than ``max_characters`` then
scrolling will occur as needed.

:return str: The full text of this label.
"""
return self.full_text

@text.setter
def text(self, new_text):
self.full_text = new_text