Drop use of is_metric in nws (#80270)

This commit is contained in:
epenet 2022-10-14 12:54:43 +02:00 committed by GitHub
parent 336ea2e7d1
commit 0715b87934
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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