Skip to content
Open
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
9 changes: 8 additions & 1 deletion mpf/devices/segment_display/segment_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ def add_text_entry(self, text, color, flashing, flash_mask, transition, transiti
raise ValueError(f"Unknown update_method '{self.config['update_method']}' for segment display {self.name}")

# For the replace-text update method, skip the stack and write straight to the display
if flashing is None:
flashing = self._current_state.flashing
if flash_mask is None:
flash_mask = self._current_state.flash_mask
if not color:
color = self._current_state.text.get_colors()

new_text = TextTemplate(self.machine, text).evaluate({})
text = SegmentDisplayText.from_str(new_text, self.size, self.config['integrated_dots'],
self.config['integrated_commas'], self.config['use_dots_for_commas'],
Expand All @@ -171,7 +178,7 @@ def add_text(self, text: str, priority: int = 0, key: str = None) -> None:
def remove_text_by_key(self, key: Optional[str]):
"""Remove entry from text stack."""
if self.config['update_method'] != "stack":
self.info_log("Segment display 'remove' action is TBD.")
self.add_text("")
return

if key in self._text_stack:
Expand Down