diff --git a/homeassistant/components/google_travel_time/config_flow.py b/homeassistant/components/google_travel_time/config_flow.py index 133baddf704..d9218566bcb 100644 --- a/homeassistant/components/google_travel_time/config_flow.py +++ b/homeassistant/components/google_travel_time/config_flow.py @@ -8,7 +8,7 @@ from homeassistant.const import CONF_API_KEY, CONF_MODE, CONF_NAME from homeassistant.core import HomeAssistant, callback from homeassistant.data_entry_flow import FlowResult import homeassistant.helpers.config_validation as cv -from homeassistant.util.unit_system import IMPERIAL_SYSTEM +from homeassistant.util.unit_system import US_CUSTOMARY_SYSTEM from .const import ( ALL_LANGUAGES, @@ -46,7 +46,7 @@ def default_options(hass: HomeAssistant) -> dict[str, str | None]: return { CONF_MODE: "driving", CONF_UNITS: ( - UNITS_IMPERIAL if hass.config.units is IMPERIAL_SYSTEM else UNITS_METRIC + UNITS_IMPERIAL if hass.config.units is US_CUSTOMARY_SYSTEM else UNITS_METRIC ), } diff --git a/homeassistant/components/waze_travel_time/config_flow.py b/homeassistant/components/waze_travel_time/config_flow.py index 348b48e3368..fd6747cc1c8 100644 --- a/homeassistant/components/waze_travel_time/config_flow.py +++ b/homeassistant/components/waze_travel_time/config_flow.py @@ -8,7 +8,7 @@ from homeassistant.const import CONF_NAME, CONF_REGION from homeassistant.core import HomeAssistant, callback from homeassistant.data_entry_flow import FlowResult import homeassistant.helpers.config_validation as cv -from homeassistant.util.unit_system import IMPERIAL_SYSTEM +from homeassistant.util.unit_system import US_CUSTOMARY_SYSTEM from .const import ( CONF_AVOID_FERRIES, @@ -35,7 +35,7 @@ from .helpers import is_valid_config_entry def default_options(hass: HomeAssistant) -> dict[str, str | bool]: """Get the default options.""" defaults = DEFAULT_OPTIONS.copy() - if hass.config.units is IMPERIAL_SYSTEM: + if hass.config.units is US_CUSTOMARY_SYSTEM: defaults[CONF_UNITS] = IMPERIAL_UNITS return defaults diff --git a/pylint/plugins/hass_imports.py b/pylint/plugins/hass_imports.py index 3d2f747ca7b..678773abcb9 100644 --- a/pylint/plugins/hass_imports.py +++ b/pylint/plugins/hass_imports.py @@ -296,6 +296,12 @@ _OBSOLETE_IMPORT: dict[str, list[ObsoleteImportMatch]] = { constant=re.compile(r"^(distance|pressure|speed|temperature|volume)$"), ), ], + "homeassistant.util.unit_system": [ + ObsoleteImportMatch( + reason="replaced by US_CUSTOMARY_SYSTEM", + constant=re.compile(r"^IMPERIAL_SYSTEM$"), + ), + ], }