-
-
Notifications
You must be signed in to change notification settings - Fork 240
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 UI] Extra space for item state with Number: items #1953
Comments
It might be the consequence of recently merged PR openhab/openhab-core#3644 that introduced the method |
For consistency, an option could be to also add the space for numbers without dimension ? |
For consistency, there should not be a space, unless explicitly specified in the pattern. I wouldn't call it a minor defect since it affects what's displayed, and is a regression from how it used to work. |
This issue will come up with units like % that tend to be concatenated to the value without space. In https:/openhab/openhab-core/blob/main/bundles/org.openhab.core.ui/src/main/java/org/openhab/core/ui/internal/items/ItemUIRegistryImpl.java#L506 potential blanks get trimmed and one blank gets readded afterwards. It is the only way to be able to identify erroneous patterns after the unit. One could isolate the leading blanks if they exist and readd that instead of a fixed blank. |
This also impacts temperature which typically doesn't have a space between the value and °. I'm also seeing an extra space when displaying the inches of rain as well:
|
That's why I wrote units like %. The same is indeed true for temperature degrees and ". Without a space, I don't think unit conversions ever worked. So it was OK as long as everything was in the same unit. But the new unit management in 4.0 helps a bit here as it forces your default unit. I agree this should, and could, be improved. But I am not able to do so myself before the OH4 release deadline. Maybe @lolodomo could have a look. |
Basic UI, especially JavaScript code, may expect a space to properly handle/detect unit. To be checked if this space is searched only in item state or also in widget label. |
To be confirmed, but normally it should also concern other sitemap UIs like the Android app. |
I believe it is OK, the space between the number and the unit is only searched on received item state, not on the received formatted label. The only exception is for slider widget but in this case there is an exception in the server side and only the number is pushed. |
Fix openhab/openhab-webui#1953 Fix a regression introduced by PR openhab#3644 Signed-off-by: Laurent Garnier <[email protected]>
I just fixed the issue in core framework. |
…3708) Fix openhab/openhab-webui#1953 Fix a regression introduced by PR #3644 Signed-off-by: Laurent Garnier <[email protected]>
Closed by core PR. |
Starting with 4.0.0.M4 there is an extra space for the item state for Number: items, this does not occur with Number items. For example:
are now displayed as:
The text was updated successfully, but these errors were encountered: