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

[mercedesme] UOM cleanup #18332

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

weymann
Copy link
Contributor

@weymann weymann commented Feb 26, 2025

MetaDataAdjuster class is a relict before Units of Measure was introduced.

Class for adjusting metadata is removed and unitHints in xml are provided.

@weymann weymann changed the title [mercedesne] UOM clenaup [mercedesme] UOM cleanup Feb 26, 2025
@weymann
Copy link
Contributor Author

weymann commented Mar 1, 2025

@jlaur
Made a mistake scheduling my PRs.
I need first PR #18342. After merge I'll continue with this one.

@jlaur jlaur added the awaiting other PR Depends on another PR label Mar 1, 2025
@lsiepel
Copy link
Contributor

lsiepel commented Mar 4, 2025

Other PR is merged, @weymann you can proceed with fixing the conflict etc.

@lsiepel lsiepel removed the awaiting other PR Depends on another PR label Mar 4, 2025
weymann added 3 commits March 4, 2025 23:59
Signed-off-by: Bernd Weymann <[email protected]>
Signed-off-by: Bernd Weymann <[email protected]>
Signed-off-by: Bernd Weymann <[email protected]>
@weymann weymann force-pushed the mercedesme-metadata-adjuster-remove branch from 4f629f3 to 7a4893d Compare March 5, 2025 00:17
@weymann
Copy link
Contributor Author

weymann commented Mar 5, 2025

Build runs fine now, ready to merge!

Copy link
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

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

Thanks. I left two comments. Otherwise LGTM

Comment on lines +104 to +106
<item-type unitHint="%">Number:Dimensionless</item-type>
<label>Charge SoC Maximum</label>
<state pattern="%d %%"/>
<state pattern="%d %unit%"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if this is going to work. As the optionlist contains % as unit, setting the unit to anything different (like One) would cause issues.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had enough beef with UOM since the beginning.
It's not a hint to configure the max charge limit - it's a fact to configure as % and not one, db, ppm or whatever the user is capable to do!
If you choose something on your own - garbage in, garbage out

Do you have any advice to do it correctly?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would just revert this the way it was, percentage is the only correct unit.

Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't One also, i.e. 0.67 rather than 67%, if this is preferred?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Isn't One also, i.e. 0.67 rather than 67%, if this is preferred?

Correct, it's shown this way.
image

I would just revert this the way it was, percentage is the only correct unit.

The user can choose unit one and it shall not been shown as 0.8 %
In above screenshot you can see there's no unit displayed if unit one is choosed.
And if users chooses unit ppm then the state pattern will show 800000 ppm

Looks good for me, I would prefer to leave it this way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants