mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 18:28:14 +02:00
Use new unit enums in weather entity (#82937)
This commit is contained in:
@ -17,6 +17,7 @@ from homeassistant.const import (
|
||||
WIND_SPEED,
|
||||
UnitOfLength,
|
||||
UnitOfMass,
|
||||
UnitOfPrecipitationDepth,
|
||||
UnitOfPressure,
|
||||
UnitOfSpeed,
|
||||
UnitOfTemperature,
|
||||
@ -247,7 +248,7 @@ validate_unit_system = vol.All(
|
||||
|
||||
METRIC_SYSTEM = UnitSystem(
|
||||
_CONF_UNIT_SYSTEM_METRIC,
|
||||
accumulated_precipitation=UnitOfLength.MILLIMETERS,
|
||||
accumulated_precipitation=UnitOfPrecipitationDepth.MILLIMETERS,
|
||||
conversions={
|
||||
# Convert non-metric distances
|
||||
("distance", UnitOfLength.FEET): UnitOfLength.METERS,
|
||||
@ -279,7 +280,7 @@ METRIC_SYSTEM = UnitSystem(
|
||||
|
||||
US_CUSTOMARY_SYSTEM = UnitSystem(
|
||||
_CONF_UNIT_SYSTEM_US_CUSTOMARY,
|
||||
accumulated_precipitation=UnitOfLength.INCHES,
|
||||
accumulated_precipitation=UnitOfPrecipitationDepth.INCHES,
|
||||
conversions={
|
||||
# Convert non-USCS distances
|
||||
("distance", UnitOfLength.CENTIMETERS): UnitOfLength.INCHES,
|
||||
|
Reference in New Issue
Block a user