mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-11 05:41:52 +01:00
parent
6eb49577fe
commit
f92424c0b8
@ -139,6 +139,8 @@ public final class Units extends CustomUnits {
|
||||
new ProductUnit<>(VOLT_AMPERE.multiply(tech.units.indriya.unit.Units.HOUR)), Energy.class);
|
||||
public static final Unit<Force> NEWTON = addUnit(tech.units.indriya.unit.Units.NEWTON);
|
||||
public static final Unit<Frequency> HERTZ = addUnit(tech.units.indriya.unit.Units.HERTZ);
|
||||
public static final Unit<Frequency> RPM = addUnit(
|
||||
new ProductUnit<>(AbstractUnit.ONE.divide(tech.units.indriya.unit.Units.MINUTE)));
|
||||
public static final Unit<Intensity> IRRADIANCE = addUnit(
|
||||
new ProductUnit<>(tech.units.indriya.unit.Units.WATT.divide(tech.units.indriya.unit.Units.SQUARE_METRE)));
|
||||
public static final Unit<Intensity> MICROWATT_PER_SQUARE_CENTIMETRE = addUnit(
|
||||
@ -276,6 +278,7 @@ public final class Units extends CustomUnits {
|
||||
SimpleUnitFormat.getInstance().label(PEBIBYTE, "PiB");
|
||||
SimpleUnitFormat.getInstance().alias(PEBIBYTE, "Pio");
|
||||
SimpleUnitFormat.getInstance().label(PETABIT, "Pbit");
|
||||
SimpleUnitFormat.getInstance().label(RPM, "rpm");
|
||||
SimpleUnitFormat.getInstance().label(STANDARD_GRAVITY, "gₙ");
|
||||
SimpleUnitFormat.getInstance().label(SIEMENS_PER_METRE, "S/m");
|
||||
SimpleUnitFormat.getInstance().label(TERABYTE, "TB");
|
||||
|
@ -387,6 +387,13 @@ public class UnitsTest {
|
||||
assertThat(converted.toString(), anyOf(is("10000 \u00B5S/cm"), is("10000 \u03BCS/cm")));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRpm() {
|
||||
QuantityType<?> oneHertz = QuantityType.valueOf("60 rpm");
|
||||
QuantityType<?> converted = oneHertz.toUnit("Hz");
|
||||
assertThat(converted.doubleValue(), is(closeTo(1.00, DEFAULT_ERROR)));
|
||||
}
|
||||
|
||||
private static class QuantityEquals extends IsEqual<Quantity<?>> {
|
||||
private Quantity<?> quantity;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user