From 9692cdaf2deae2690b67262c2f3a0f2c22462740 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 22 Sep 2022 21:02:31 +0200 Subject: [PATCH] Make _is_valid_unit private in unit system (#78924) --- homeassistant/util/unit_system.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/util/unit_system.py b/homeassistant/util/unit_system.py index e964fee798c..5d8334c6686 100644 --- a/homeassistant/util/unit_system.py +++ b/homeassistant/util/unit_system.py @@ -53,7 +53,7 @@ WIND_SPEED_UNITS = speed_util.VALID_UNITS 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.""" if unit_type == LENGTH: units = LENGTH_UNITS @@ -101,7 +101,7 @@ class UnitSystem: (mass, MASS), (pressure, PRESSURE), ) - if not is_valid_unit(unit, unit_type) + if not _is_valid_unit(unit, unit_type) ) if errors: