"""Distance util functions.""" from __future__ import annotations from homeassistant.const import ( # pylint: disable=unused-import # noqa: F401 LENGTH, LENGTH_CENTIMETERS, LENGTH_FEET, LENGTH_INCHES, LENGTH_KILOMETERS, LENGTH_METERS, LENGTH_MILES, LENGTH_MILLIMETERS, LENGTH_YARD, UNIT_NOT_RECOGNIZED_TEMPLATE, ) from .unit_conversion import DistanceConverter VALID_UNITS = DistanceConverter.VALID_UNITS def convert(value: float, from_unit: str, to_unit: str) -> float: """Convert one unit of measurement to another.""" return DistanceConverter.convert(value, from_unit, to_unit)