openhab-core/bundles/org.openhab.core.ui
Cody Cutrer 3659542bae
Support mired units (#3108)
* Support mired units

Mired are fairly common to describe the color temperature of
lightbulbs (slightly less common than Kelvin), but are very
useful for various calculations when adjusting the color
temperature, as well as being necessary for various integerations
that require mired units.

This commit makes them a well-known unit (previously they were
still usable, using "MK^-1"), as well as making them easier to
work with on QuantityType. The hiccup is that Mireds aren't
technically a Temperature dimension, because they're a reciprocal.
So add a `inverse` method that delegates to javax.measure's
same method, and then use it as necessary when doing unit
conversions and comparisons. Unfortunately, because the
dimension changes, the return value of a conversion won't
necessarily be the same type, an additional method is added
for callers that are willing to handle the change in
dimension. This is implemented for all callers that can use
it in core.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-10-16 13:50:46 +02:00
..
src Support mired units (#3108) 2022-10-16 13:50:46 +02:00
.classpath [infrastructure] add external null-annotations (#1775) 2020-11-03 21:33:48 +01:00
.project mavenize openHAB and integrate mavenized ESH repository (#467) 2019-01-28 13:07:31 +01:00
bnd.bnd Renamed packages 2019-12-28 12:18:16 +01:00
NOTICE Updated NOTICE files to openHAB (#578) 2019-02-15 10:46:18 +01:00
pom.xml Apply spotless and resolver (#3018) 2022-06-27 13:41:28 +02:00