-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
base: main
Are you sure you want to change the base?
[mercedesme] UOM cleanup #18332
Conversation
bundles/org.openhab.binding.mercedesme/src/main/resources/OH-INF/thing/eco-channel-types.xml
Outdated
Show resolved
Hide resolved
Other PR is merged, @weymann you can proceed with fixing the conflict etc. |
Signed-off-by: Bernd Weymann <[email protected]>
Signed-off-by: Bernd Weymann <[email protected]>
Signed-off-by: Bernd Weymann <[email protected]>
4f629f3
to
7a4893d
Compare
Build runs fine now, ready to merge! |
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. I left two comments. Otherwise LGTM
<item-type unitHint="%">Number:Dimensionless</item-type> | ||
<label>Charge SoC Maximum</label> | ||
<state pattern="%d %%"/> | ||
<state pattern="%d %unit%"/> |
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.
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.
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.
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?
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.
I would just revert this the way it was, percentage is the only correct unit.
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.
Isn't One
also, i.e. 0.67 rather than 67%, if this is preferred?
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.
Isn't
One
also, i.e. 0.67 rather than 67%, if this is preferred?
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.
MetaDataAdjuster
class is a relict before Units of Measure was introduced.Class for adjusting metadata is removed and
unitHints
in xml are provided.