Skip to content

Conversation

DrRSatzteil
Copy link
Contributor

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.

@DrRSatzteil DrRSatzteil deleted the multicolor branch October 11, 2025 00:58
@DrRSatzteil DrRSatzteil restored the multicolor branch October 11, 2025 00:58
@DrRSatzteil DrRSatzteil reopened this Oct 11, 2025
@DrRSatzteil DrRSatzteil changed the title [mqtt.awtrixlight] Parse font tags for multi-colored app texts [mqtt.awtrix3] Parse font tags for multi-colored app texts Oct 11, 2025
@lsiepel lsiepel requested a review from Copilot October 11, 2025 09:31
@lsiepel lsiepel added the enhancement An enhancement or new feature for an existing add-on label Oct 11, 2025
Copy link

@Copilot Copilot AI left a 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.

Signed-off-by: Thomas Lauterbach <2452988+DrRSatzteil@users.noreply.github.com>
Signed-off-by: Thomas Lauterbach <2452988+DrRSatzteil@users.noreply.github.com>
Signed-off-by: Thomas Lauterbach <2452988+DrRSatzteil@users.noreply.github.com>
Copy link
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks LGTM

@lsiepel lsiepel merged commit f63c36c into openhab:main Oct 11, 2025
2 checks passed
@lsiepel lsiepel added this to the 5.1 milestone Oct 11, 2025
@DrRSatzteil DrRSatzteil deleted the multicolor branch October 11, 2025 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement An enhancement or new feature for an existing add-on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants