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] Space added when formatting Number:Time with pattern %1$tH #3722

Closed
jlaur opened this issue Jul 21, 2023 · 3 comments
Closed

[Sitemap] Space added when formatting Number:Time with pattern %1$tH #3722

jlaur opened this issue Jul 21, 2023 · 3 comments
Labels
bug An unexpected problem or unintended behavior of the Core

Comments

@jlaur
Copy link
Contributor

jlaur commented Jul 21, 2023

Given:

items/repro.items:

Number:Time Repro_Pattern "Pattern [X%1$tHX]" <time>

sitemaps/sitemaps.items:

sitemap repro label="Repro" {
        Text item=Repro_Pattern
}

Set value:

openhab:update Repro_Pattern "60 min"

MainUI:
image

But sitemap has a space added:
image

Expected Behavior

When using the provided pattern there should not be any spaces added.

Current Behavior

A space is added at the end. The same is true for the pattern %1$tH, for example. However, if both are used, space is only added after the first, so X%1$tHX%1$tMX will become "X01 X00X".

Possible Solution

Possible regression of #3644. See also openhab/openhab-webui#1953.

Steps to Reproduce

See description.

Context

This breaks formatting with state pattern %1$tH:%1$tM. For this specific pattern a work-around is to use %1$tR. This was fixed just in time for RC1 for the Miele@home binding: openhab/openhab-addons#15280, but other bindings (and user configuration) can easily be affected.

I did not observe this problem in 3.4.4, so it seems to be a 4.0 regression.

Your Environment

  • Version used: 4.0M5
@jlaur jlaur added the bug An unexpected problem or unintended behavior of the Core label Jul 21, 2023
@jlaur
Copy link
Contributor Author

jlaur commented Jul 21, 2023

FYI @lolodomo, @mherwege

@openhab-bot
Copy link
Collaborator

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/openhab-4-0-milestone-discussion/145133/620

@jlaur
Copy link
Contributor Author

jlaur commented Jul 21, 2023

Fixed in RC1, probably same issue as fixed by #3708.

@jlaur jlaur closed this as completed Jul 21, 2023
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

No branches or pull requests

2 participants