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

Sitemap editor: Fix color and icon rules #4449

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

mherwege
Copy link
Contributor

@mherwege mherwege commented Nov 13, 2024

Closes #4431

This closes an issue with color and icon rules when no item and comparator was provided in the rule (should default to item of the widget and == comparator) and the rule condition started with an alpha character.

@mherwege mherwege requested a review from a team as a code owner November 13, 2024 23:21
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
@mherwege mherwege changed the title Fix color and icon rules Sitemap editor: Fix color and icon rules Nov 16, 2024
@lolodomo
Copy link
Contributor

lolodomo commented Nov 17, 2024

I don't understand the case that was wrong. Can you please provide an example of sitemap element that was not matched ?

@mherwege
Copy link
Contributor Author

I don't understand the case that was wrong. Can you please provide an example of sitemap element that was not matched ?

@lolodomo Look at the linked issue.

Switch icon=if:mdi:lightbulb item=licht_nachthal label="Nachthal" mappings=[ON="Aan", OFF="Uit"] iconcolor=[ON="yellow"]

The ON in the iconcolor was split by the regex in O and N, the O being interpreted as the item.

@lolodomo
Copy link
Contributor

lolodomo commented Nov 18, 2024

Ok. If you tested it, it is fine for me.
I see that it is a change only for sitemap generator.

@mherwege
Copy link
Contributor Author

Ok. If you rested it, it is fine for me. I see that it is a change only for sitemap generator.

Indeed, only relevant to the sitemap generator, that was using a regex to split the rule in its parts. I tested with the examples from the linked issue.

Copy link
Member

@holgerfriedrich holgerfriedrich left a comment

Choose a reason for hiding this comment

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

LGTM

@holgerfriedrich holgerfriedrich merged commit d7495d2 into openhab:main Nov 18, 2024
5 checks passed
@holgerfriedrich holgerfriedrich added the bug An unexpected problem or unintended behavior of the Core label Nov 18, 2024
@holgerfriedrich holgerfriedrich added this to the 4.3 milestone Nov 18, 2024
@mherwege mherwege deleted the icon_rules branch November 18, 2024 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of the Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sitemap icon rules / icon colors doesnt work when code is generated by MainUI
3 participants