-
-
Notifications
You must be signed in to change notification settings - Fork 431
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
Upgrade Units of Measurement dependencies #2319
Conversation
Upgrades UoM dependencies to: * javax.measure 2.1.2 * si-units 2.0.1 * indriya 2.1.2 An openHAB OSGi-ified si-units bundle is used as runtime dependency, because the latest si-units release is still missing proper OSGi manifest headers. Notable changes: * Quantity not longer implements an `equals` method, so the unit tests had to be adjusted. This should have any impact outside of the unit tests though since the rest of openHAB should be using QuantityType instead. * RationalConverter is not package private, so instances of it much be created through the MultiplyConverter static functions. * Quantities.getQuantity can no longer parse values without units like `100`. A workaround has been implemented. * The unicode greek `mu` letter is now returned for unit prefixes instead of the unicode `micro` character. These characters are visually identical but the unit tests had to be adjusted. The new library seems to parse both types just fine. Also-by: Connor Petty <mistercpp2000+gitsignoff@gmail.com> Signed-off-by: Wouter Born <github@maindrain.net>
Ah, success! 😄 |
Friendly "ready for review" ping @openhab/core-maintainers. |
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.
Looks all good to me, thanks for this huge effort!
Edit: never mind I just saw the other freshly merged PRs I incidentally installed the latest snapshot - which I haven't done in weeks - and now none of the addons install 😢
Presumably it's because of this change. I have indeed the UoM library in version 2.x now:
Is there something to do on my side to fix this? |
Yes build # 2373 unfortunately didn't have all changes. |
2374 works indeed, I was unlucky, now everything's fine - sorry for the bother! |
I did have some new UoM exceptions related to rrd4j on start though - but it was a couple times on start and now I can't reproduce them. I don't know which items they related to. Charting items with dimensions from the UI seems to work as before.
|
Thanks for reporting it. I will keep an eye on my logs and see if I can reproduce it. There have been quite a few changes in the new UoM implementation, so I can imagine there are also a few regressions. |
I added the "API breaking" label. Some bundles might need to adopt their code to handle the new |
Hi, some more errors: e.g. openweather binding: Current dew point 908,0 °C, Current Gust Speed 1728,0 km/h
|
Upgrades UoM dependencies to: * javax.measure 2.1.2 * si-units 2.0.1 * indriya 2.1.2 An openHAB OSGi-ified si-units bundle is used as runtime dependency, because the latest si-units release is still missing proper OSGi manifest headers. Notable changes: * Quantity not longer implements an `equals` method, so the unit tests had to be adjusted. This should have any impact outside of the unit tests though since the rest of openHAB should be using QuantityType instead. * RationalConverter is not package private, so instances of it much be created through the MultiplyConverter static functions. * Quantities.getQuantity can no longer parse values without units like `100`. A workaround has been implemented. * The unicode greek `mu` letter is now returned for unit prefixes instead of the unicode `micro` character. These characters are visually identical but the unit tests had to be adjusted. The new library seems to parse both types just fine. Also-by: Connor Petty <mistercpp2000+gitsignoff@gmail.com> Signed-off-by: Wouter Born <github@maindrain.net>
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/resol-binding-stopped-working-in-recent-nightly-builds/122371/4 |
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/openhab-3-1-milestone-discussion/116025/181 |
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/broadlink-binding-for-rmx-a1-spx-and-mp-any-interest/22768/1392 |
This pull request has been mentioned on openHAB Community. There might be relevant details there: |
quantity = (Quantity<T>) Quantities.getQuantity(formatted); | ||
if (!formatted.contains(" ")) { | ||
BigDecimal bd = new BigDecimal(value); | ||
quantity = (Quantity<T>) Quantities.getQuantity(bd, AbstractUnit.ONE, Scale.RELATIVE); |
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.
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.
IIRC such a change would cause a lot more rules to break.
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 didn't want to suggest changing it. I was just wondering if this was a deliberate decision or not. Because #3177 only works because of this.
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.
If there was no legacy code and there were no openHAB users I would also opt for using all the default behaviors. 🙂
Upgrades UoM dependencies to: * javax.measure 2.1.2 * si-units 2.0.1 * indriya 2.1.2 An openHAB OSGi-ified si-units bundle is used as runtime dependency, because the latest si-units release is still missing proper OSGi manifest headers. Notable changes: * Quantity not longer implements an `equals` method, so the unit tests had to be adjusted. This should have any impact outside of the unit tests though since the rest of openHAB should be using QuantityType instead. * RationalConverter is not package private, so instances of it much be created through the MultiplyConverter static functions. * Quantities.getQuantity can no longer parse values without units like `100`. A workaround has been implemented. * The unicode greek `mu` letter is now returned for unit prefixes instead of the unicode `micro` character. These characters are visually identical but the unit tests had to be adjusted. The new library seems to parse both types just fine. Also-by: Connor Petty <mistercpp2000+gitsignoff@gmail.com> Signed-off-by: Wouter Born <github@maindrain.net> GitOrigin-RevId: 9130799
Based on #1664
Depends on openhab/openhab-osgiify#19
Upgrades UoM dependencies to:
An openHAB OSGi-ified si-units bundle is used as runtime dependency, because the latest si-units release is still missing proper OSGi manifest headers.
Notable changes:
equals
method, so the unit tests had to be adjusted. This should have any impact outside of the unit tests though since the rest of openHAB should be using QuantityType instead.100
. A workaround has been implemented.mu
letter is now returned for unit prefixes instead of the unicodemicro
character. These characters are visually identical but the unit tests had to be adjusted. The new library seems to parse both types just fine.