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

Fix UnitUtils.getDimensionName returns Angle instead of Dimensionless #2895

Merged
merged 1 commit into from
Apr 14, 2022

Conversation

wborn
Copy link
Member

@wborn wborn commented Apr 4, 2022

An Angle is also Dimensionless and because it is the first compatible unit it is always returned instead of any other Dimensionless unit.
With these changes getDimensionName will prefer the dimension of equal units over those of compatible units.

Fixes #2880

@wborn wborn added the bug An unexpected problem or unintended behavior of the Core label Apr 4, 2022
@wborn wborn requested a review from a team as a code owner April 4, 2022 12:30
@wborn wborn force-pushed the fix-getdimensionname branch 2 times, most recently from a8802db to 7d8014a Compare April 4, 2022 12:48
An Angle is also Dimensionless and because it is the first compatible unit it is always returned instead of any other Dimensionless unit.
With these changes `getDimensionName` will prefer the dimension of equal units over those of compatible units.

Fixes openhab#2880

Signed-off-by: Wouter Born <github@maindrain.net>
Copy link
Member

@kaikreuzer kaikreuzer left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

@kaikreuzer kaikreuzer merged commit a4353ee into openhab:main Apr 14, 2022
@kaikreuzer kaikreuzer added this to the 3.3 milestone Apr 14, 2022
@wborn wborn deleted the fix-getdimensionname branch April 14, 2022 20:58
splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 12, 2023
…openhab#2895)

An Angle is also Dimensionless and because it is the first compatible unit it is always returned instead of any other Dimensionless unit.
With these changes `getDimensionName` will prefer the dimension of equal units over those of compatible units.

Fixes openhab#2880

Signed-off-by: Wouter Born <github@maindrain.net>
GitOrigin-RevId: a4353ee
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.

UnitUtils.getDimensionName wrong result
2 participants