mirror of
https://github.com/home-assistant/core.git
synced 2025-08-07 06:35:10 +02:00
Drop use of is_metric
in weather (#80272)
This commit is contained in:
@@ -44,6 +44,7 @@ from homeassistant.util.unit_conversion import (
|
|||||||
SpeedConverter,
|
SpeedConverter,
|
||||||
TemperatureConverter,
|
TemperatureConverter,
|
||||||
)
|
)
|
||||||
|
from homeassistant.util.unit_system import METRIC_SYSTEM
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -419,7 +420,9 @@ class WeatherEntity(Entity):
|
|||||||
|
|
||||||
Should not be set by integrations.
|
Should not be set by integrations.
|
||||||
"""
|
"""
|
||||||
return PRESSURE_HPA if self.hass.config.units.is_metric else PRESSURE_INHG
|
return (
|
||||||
|
PRESSURE_HPA if self.hass.config.units is METRIC_SYSTEM else PRESSURE_INHG
|
||||||
|
)
|
||||||
|
|
||||||
@final
|
@final
|
||||||
@property
|
@property
|
||||||
@@ -483,7 +486,7 @@ class WeatherEntity(Entity):
|
|||||||
"""
|
"""
|
||||||
return (
|
return (
|
||||||
SPEED_KILOMETERS_PER_HOUR
|
SPEED_KILOMETERS_PER_HOUR
|
||||||
if self.hass.config.units.is_metric
|
if self.hass.config.units is METRIC_SYSTEM
|
||||||
else SPEED_MILES_PER_HOUR
|
else SPEED_MILES_PER_HOUR
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user