Use US_CUSTOMARY_SYSTEM in components (#80623)

This commit is contained in:
epenet 2022-10-19 18:54:50 +02:00 committed by GitHub
parent 374d46ec09
commit 2b2275dfb3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 43 additions and 39 deletions

View file

@ -21,7 +21,7 @@ from homeassistant.const import (
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import StateType
from homeassistant.util.unit_system import IMPERIAL_SYSTEM, UnitSystem
from homeassistant.util.unit_system import US_CUSTOMARY_SYSTEM, UnitSystem
from . import MazdaEntity
from .const import DATA_CLIENT, DATA_COORDINATOR, DOMAIN
@ -51,7 +51,7 @@ class MazdaSensorEntityDescription(
def _get_distance_unit(unit_system: UnitSystem) -> str:
"""Return the distance unit for the given unit system."""
if unit_system is IMPERIAL_SYSTEM:
if unit_system is US_CUSTOMARY_SYSTEM:
return LENGTH_MILES
return LENGTH_KILOMETERS