mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Drop use of is_metric
in nws (#80270)
This commit is contained in:
parent
336ea2e7d1
commit
0715b87934
@ -23,6 +23,7 @@ from homeassistant.util.unit_conversion import (
|
||||
PressureConverter,
|
||||
SpeedConverter,
|
||||
)
|
||||
from homeassistant.util.unit_system import IMPERIAL_SYSTEM
|
||||
|
||||
from . import base_unique_id, device_info
|
||||
from .const import (
|
||||
@ -80,7 +81,7 @@ class NWSSensor(CoordinatorEntity, SensorEntity):
|
||||
self.entity_description = description
|
||||
|
||||
self._attr_name = f"{station} {description.name}"
|
||||
if not hass.config.units.is_metric:
|
||||
if hass.config.units is IMPERIAL_SYSTEM:
|
||||
self._attr_native_unit_of_measurement = description.unit_convert
|
||||
|
||||
@property
|
||||
|
@ -107,7 +107,6 @@ class NWSWeather(WeatherEntity):
|
||||
self.coordinator_forecast = hass_data[COORDINATOR_FORECAST_HOURLY]
|
||||
self.station = self.nws.station
|
||||
|
||||
self.is_metric = units.is_metric
|
||||
self.mode = mode
|
||||
|
||||
self.observation = None
|
||||
|
Loading…
x
Reference in New Issue
Block a user