Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2024.6.1: Add multicolor text support #237

Merged

Conversation

andrewjswan
Copy link

multicolor_text (optional, boolean): If true, enables text multi color support when displaying text.

Example:

ehmtxv2:
  id: rgb8x32
...
  multicolor_text: true
service: esphome.ulanzi_text_screen
data:
  default_font: true
  text: "Test Test #00FF00Test #FF0000Test #0000FFTest"
  lifetime: 2
  screen_time: 10
  r: 255
  g: 255
  b: 255

Shows text in different colors, Test Test in the default color #FFFFFF (r: 255, g:255, b: 255), followed by Test in green #00FF00, then Test in red #FF0000 and finally Test in blue #0000FF.

@lubeda lubeda changed the base branch from latest to 2024.6.pre June 8, 2024 11:09
@lubeda lubeda merged commit 86b82ed into lubeda:2024.6.pre Jun 8, 2024
1 check passed
@lubeda
Copy link
Owner

lubeda commented Jun 8, 2024

This nice addition makes everything to slow:

[13:26:02][W][component:237]: Component display took a long time for an operation (61 ms).
[13:26:02][W][component:238]: Components should block for at most 30 ms.

@andrewjswan
Copy link
Author

Yes, it happens. And only once during the first screen display, during the display it does not happen anymore. I think because of Regex.
On short text, or when there are few color changes, this does not happen, for example Default #00FF00Green works without this message.

@andrewjswan
Copy link
Author

We can add a warning in the Readme that performance may decrease. Or not add it.

Warning

In this mode, with a large number of color changes, or with long lines, a short-term decrease in performance is possible.

@andrewjswan andrewjswan deleted the 2024.6.1-Add_multicolor_text_support branch June 8, 2024 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants