mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 14:47:38 +00:00
Make _is_valid_unit private in unit system (#78924)
This commit is contained in:
parent
5c7d40cccf
commit
9692cdaf2d
@ -53,7 +53,7 @@ WIND_SPEED_UNITS = speed_util.VALID_UNITS
|
|||||||
TEMPERATURE_UNITS: tuple[str, ...] = (TEMP_FAHRENHEIT, TEMP_CELSIUS)
|
TEMPERATURE_UNITS: tuple[str, ...] = (TEMP_FAHRENHEIT, TEMP_CELSIUS)
|
||||||
|
|
||||||
|
|
||||||
def is_valid_unit(unit: str, unit_type: str) -> bool:
|
def _is_valid_unit(unit: str, unit_type: str) -> bool:
|
||||||
"""Check if the unit is valid for it's type."""
|
"""Check if the unit is valid for it's type."""
|
||||||
if unit_type == LENGTH:
|
if unit_type == LENGTH:
|
||||||
units = LENGTH_UNITS
|
units = LENGTH_UNITS
|
||||||
@ -101,7 +101,7 @@ class UnitSystem:
|
|||||||
(mass, MASS),
|
(mass, MASS),
|
||||||
(pressure, PRESSURE),
|
(pressure, PRESSURE),
|
||||||
)
|
)
|
||||||
if not is_valid_unit(unit, unit_type)
|
if not _is_valid_unit(unit, unit_type)
|
||||||
)
|
)
|
||||||
|
|
||||||
if errors:
|
if errors:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user