Skip to content

Commit 259079e

Browse files
authored
Merge pull request #88 from Lnk2past/master
Add text kwarg to optionally forward to PortalBase.add_text
2 parents 0add9c7 + f13e135 commit 259079e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

adafruit_matrixportal/matrixportal.py

+7
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ def add_text(
144144
line_spacing=1.25,
145145
text_anchor_point=(0, 0.5),
146146
is_data=True,
147+
text=None,
147148
):
148149
"""
149150
Add text labels with settings
@@ -166,6 +167,11 @@ def add_text(
166167
:param (float, float) text_anchor_point: Values between 0 and 1 to indicate where the text
167168
position is relative to the label
168169
:param bool is_data: If True, fetch will attempt to update the label
170+
:param str text: If this is provided, it will set the initial text of the label.
171+
172+
:return: Index of the new text label.
173+
:rtype: int
174+
169175
"""
170176
if scrolling:
171177
if text_position is None:
@@ -185,6 +191,7 @@ def add_text(
185191
line_spacing=line_spacing,
186192
text_anchor_point=text_anchor_point,
187193
is_data=is_data,
194+
text=text,
188195
)
189196

190197
self._text[index]["scrolling"] = scrolling

0 commit comments

Comments
 (0)