[mqtt.awtrix3] Parse font tags for multi-colored app texts#19466
Merged
lsiepel merged 3 commits intoopenhab:mainfrom Oct 11, 2025
Merged
[mqtt.awtrix3] Parse font tags for multi-colored app texts#19466lsiepel merged 3 commits intoopenhab:mainfrom
lsiepel merged 3 commits intoopenhab:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.