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
Fix QuantityType dimensionless one and time formatting #4169
Conversation
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thankyou.
@mherwege many thanks. I like the extra bonus for the duration formatting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
We have a few failing tests in the add-ons now, see https://ci.openhab.org/job/openHAB-Addons/lastCompletedBuild/testReport/. Might these be related to this change, @mherwege? |
It probably is. I am investigating. It looks like the mqtt tests assume a formatting of a QuantityType with format pattern %s just drops the unit. It may have done that in the past because in core, first a conversion to BigDecimal (which dropped the unit) was attempted before passing the value verbatim (with unit). I don't think the unit should be dropped like that when formatting a Number with Dimension. |
@kaikreuzer I have made a change to the MQTT binding that resolves the issue caused by the change in this PR. The fundamental problem is that the |
@mherwege Many thanks for taking care of it so quickly! |
Resolves #4166
Resolves #4163
This PR tries to resolve two issues with QuantityType: