Use two words for Nautical miles unit (#126905)
parent
b78a1f7b61
commit
ffa6b5fcb2
|
@ -896,7 +896,7 @@ class UnitOfLength(StrEnum):
|
|||
FEET = "ft"
|
||||
YARDS = "yd"
|
||||
MILES = "mi"
|
||||
NAUTICALMILES = "nmi"
|
||||
NAUTICAL_MILES = "nmi"
|
||||
|
||||
|
||||
_DEPRECATED_LENGTH_MILLIMETERS: Final = DeprecatedConstantEnum(
|
||||
|
|
|
@ -158,12 +158,12 @@ class DistanceConverter(BaseUnitConverter):
|
|||
UnitOfLength.FEET: 1 / _FOOT_TO_M,
|
||||
UnitOfLength.YARDS: 1 / _YARD_TO_M,
|
||||
UnitOfLength.MILES: 1 / _MILE_TO_M,
|
||||
UnitOfLength.NAUTICALMILES: 1 / _NAUTICAL_MILE_TO_M,
|
||||
UnitOfLength.NAUTICAL_MILES: 1 / _NAUTICAL_MILE_TO_M,
|
||||
}
|
||||
VALID_UNITS = {
|
||||
UnitOfLength.KILOMETERS,
|
||||
UnitOfLength.MILES,
|
||||
UnitOfLength.NAUTICALMILES,
|
||||
UnitOfLength.NAUTICAL_MILES,
|
||||
UnitOfLength.FEET,
|
||||
UnitOfLength.METERS,
|
||||
UnitOfLength.CENTIMETERS,
|
||||
|
|
|
@ -238,7 +238,7 @@ METRIC_SYSTEM = UnitSystem(
|
|||
("distance", UnitOfLength.FEET): UnitOfLength.METERS,
|
||||
("distance", UnitOfLength.INCHES): UnitOfLength.MILLIMETERS,
|
||||
("distance", UnitOfLength.MILES): UnitOfLength.KILOMETERS,
|
||||
("distance", UnitOfLength.NAUTICALMILES): UnitOfLength.KILOMETERS,
|
||||
("distance", UnitOfLength.NAUTICAL_MILES): UnitOfLength.KILOMETERS,
|
||||
("distance", UnitOfLength.YARDS): UnitOfLength.METERS,
|
||||
# Convert non-metric volumes of gas meters
|
||||
("gas", UnitOfVolume.CENTUM_CUBIC_FEET): UnitOfVolume.CUBIC_METERS,
|
||||
|
|
|
@ -173,13 +173,13 @@ _CONVERTED_VALUE: dict[
|
|||
(5, UnitOfLength.MILES, 8800.0, UnitOfLength.YARDS),
|
||||
(5, UnitOfLength.MILES, 26400.0008448, UnitOfLength.FEET),
|
||||
(5, UnitOfLength.MILES, 316800.171072, UnitOfLength.INCHES),
|
||||
(5, UnitOfLength.NAUTICALMILES, 9.26, UnitOfLength.KILOMETERS),
|
||||
(5, UnitOfLength.NAUTICALMILES, 9260.0, UnitOfLength.METERS),
|
||||
(5, UnitOfLength.NAUTICALMILES, 926000.0, UnitOfLength.CENTIMETERS),
|
||||
(5, UnitOfLength.NAUTICALMILES, 9260000.0, UnitOfLength.MILLIMETERS),
|
||||
(5, UnitOfLength.NAUTICALMILES, 10126.859142607176, UnitOfLength.YARDS),
|
||||
(5, UnitOfLength.NAUTICALMILES, 30380.57742782153, UnitOfLength.FEET),
|
||||
(5, UnitOfLength.NAUTICALMILES, 364566.9291338583, UnitOfLength.INCHES),
|
||||
(5, UnitOfLength.NAUTICAL_MILES, 9.26, UnitOfLength.KILOMETERS),
|
||||
(5, UnitOfLength.NAUTICAL_MILES, 9260.0, UnitOfLength.METERS),
|
||||
(5, UnitOfLength.NAUTICAL_MILES, 926000.0, UnitOfLength.CENTIMETERS),
|
||||
(5, UnitOfLength.NAUTICAL_MILES, 9260000.0, UnitOfLength.MILLIMETERS),
|
||||
(5, UnitOfLength.NAUTICAL_MILES, 10126.859142607176, UnitOfLength.YARDS),
|
||||
(5, UnitOfLength.NAUTICAL_MILES, 30380.57742782153, UnitOfLength.FEET),
|
||||
(5, UnitOfLength.NAUTICAL_MILES, 364566.9291338583, UnitOfLength.INCHES),
|
||||
(5, UnitOfLength.YARDS, 0.004572, UnitOfLength.KILOMETERS),
|
||||
(5, UnitOfLength.YARDS, 4.572, UnitOfLength.METERS),
|
||||
(5, UnitOfLength.YARDS, 457.2, UnitOfLength.CENTIMETERS),
|
||||
|
|
|
@ -725,7 +725,7 @@ UNCONVERTED_UNITS_US_SYSTEM = {
|
|||
SensorDeviceClass.DISTANCE: (
|
||||
UnitOfLength.FEET,
|
||||
UnitOfLength.INCHES,
|
||||
UnitOfLength.NAUTICALMILES,
|
||||
UnitOfLength.NAUTICAL_MILES,
|
||||
UnitOfLength.MILES,
|
||||
UnitOfLength.YARDS,
|
||||
),
|
||||
|
|
Loading…
Reference in New Issue