mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Refactored deprecated UNITS (#97368)
This commit is contained in:
@@ -19,15 +19,15 @@ from homeassistant.components import group
|
||||
from homeassistant.config import async_process_ha_core_config
|
||||
from homeassistant.const import (
|
||||
ATTR_UNIT_OF_MEASUREMENT,
|
||||
LENGTH_METERS,
|
||||
LENGTH_MILLIMETERS,
|
||||
MASS_GRAMS,
|
||||
STATE_ON,
|
||||
STATE_UNAVAILABLE,
|
||||
TEMP_CELSIUS,
|
||||
VOLUME_LITERS,
|
||||
UnitOfLength,
|
||||
UnitOfMass,
|
||||
UnitOfPrecipitationDepth,
|
||||
UnitOfPressure,
|
||||
UnitOfSpeed,
|
||||
UnitOfTemperature,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.exceptions import TemplateError
|
||||
@@ -52,12 +52,12 @@ def _set_up_units(hass: HomeAssistant) -> None:
|
||||
"""Set up the tests."""
|
||||
hass.config.units = UnitSystem(
|
||||
"custom",
|
||||
accumulated_precipitation=LENGTH_MILLIMETERS,
|
||||
accumulated_precipitation=UnitOfPrecipitationDepth.MILLIMETERS,
|
||||
conversions={},
|
||||
length=LENGTH_METERS,
|
||||
mass=MASS_GRAMS,
|
||||
length=UnitOfLength.METERS,
|
||||
mass=UnitOfMass.GRAMS,
|
||||
pressure=UnitOfPressure.PA,
|
||||
temperature=TEMP_CELSIUS,
|
||||
temperature=UnitOfTemperature.CELSIUS,
|
||||
volume=VOLUME_LITERS,
|
||||
wind_speed=UnitOfSpeed.KILOMETERS_PER_HOUR,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user