-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[mqtt.awtrix3] Parse font tags for multi-colored app texts #19466
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements font color tag parsing for the MQTT Awtrix3 binding, allowing users to display text with multiple colors using HTML-style font tags. When font tags are detected in the text, the implementation switches from using simple text to a structured text segment array where each segment has its own color.
Key changes:
- Added text parsing logic to detect and process
<font color="#RRGGBB">text</font>
tags - Modified text processing to conditionally apply text effects only when font tags are not present
- Added comprehensive test coverage for various font tag scenarios
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
AwtrixApp.java | Implements font tag parsing logic with TextSegment class and conditional text effect handling |
AwtrixAppTest.java | Adds comprehensive test coverage for font tag parsing scenarios |
README.md | Documents the new font color tag feature with syntax, examples, and usage notes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...t.awtrixlight/src/main/java/org/openhab/binding/mqtt/awtrixlight/internal/app/AwtrixApp.java
Show resolved
Hide resolved
...t.awtrixlight/src/main/java/org/openhab/binding/mqtt/awtrixlight/internal/app/AwtrixApp.java
Outdated
Show resolved
Hide resolved
...t.awtrixlight/src/main/java/org/openhab/binding/mqtt/awtrixlight/internal/app/AwtrixApp.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Thomas Lauterbach <2452988+DrRSatzteil@users.noreply.github.com>
Signed-off-by: Thomas Lauterbach <2452988+DrRSatzteil@users.noreply.github.com>
d6b2bc3
to
387145f
Compare
Signed-off-by: Thomas Lauterbach <2452988+DrRSatzteil@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks LGTM
This PR adds text parsing for the text channel. You may use html-style tags like these RED to color only parts of your app text. The color channel defines the default color and text effects as well as gradient colors will be ignored when font tags are used.