Fixed name of measurement systems (#1717)
Signed-off-by: Kai Kreuzer <kai@openhab.org>pull/1719/head
parent
0d1a15ef34
commit
e9ffff9f01
|
@ -153,10 +153,10 @@ public class I18nProviderImpl
|
|||
|
||||
final SystemOfUnits newMeasurementSystem;
|
||||
switch (ms) {
|
||||
case "SI":
|
||||
case SIUnits.MEASUREMENT_SYSTEM_NAME:
|
||||
newMeasurementSystem = SIUnits.getInstance();
|
||||
break;
|
||||
case "US":
|
||||
case ImperialUnits.MEASUREMENT_SYSTEM_NAME:
|
||||
newMeasurementSystem = ImperialUnits.getInstance();
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -39,6 +39,8 @@ import tec.uom.se.unit.Units;
|
|||
@NonNullByDefault
|
||||
public final class ImperialUnits extends CustomUnits {
|
||||
|
||||
public static final String MEASUREMENT_SYSTEM_NAME = "US";
|
||||
|
||||
private static final ImperialUnits INSTANCE = new ImperialUnits();
|
||||
|
||||
/** Additionally defined units to be used in openHAB **/
|
||||
|
@ -110,4 +112,9 @@ public final class ImperialUnits extends CustomUnits {
|
|||
INSTANCE.units.add(unit);
|
||||
return unit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return MEASUREMENT_SYSTEM_NAME;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,6 +36,8 @@ import tec.uom.se.unit.Units;
|
|||
@NonNullByDefault
|
||||
public final class SIUnits extends CustomUnits {
|
||||
|
||||
public static final String MEASUREMENT_SYSTEM_NAME = "SI";
|
||||
|
||||
private static final SIUnits INSTANCE = new SIUnits();
|
||||
|
||||
public static final Unit<Temperature> CELSIUS = addUnit(Units.CELSIUS);
|
||||
|
@ -75,4 +77,9 @@ public final class SIUnits extends CustomUnits {
|
|||
INSTANCE.units.add(unit);
|
||||
return unit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return MEASUREMENT_SYSTEM_NAME;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue