From 8fdf35b80ac60997c771ddd7392017a329a854a0 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Mon, 5 Dec 2022 20:03:47 +0100 Subject: [PATCH] Introduce UnitOfFrequency enum (#83289) --- homeassistant/const.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/homeassistant/const.py b/homeassistant/const.py index ea2545a72de..361d2f8545c 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -619,11 +619,25 @@ LENGTH_YARD: Final = "yd" LENGTH_MILES: Final = "mi" """Deprecated: please use UnitOfLength.MILES.""" + # Frequency units +class UnitOfFrequency(StrEnum): + """Frequency units.""" + + HERTZ = "Hz" + KILOHERTZ = "kHz" + MEGAHERTZ = "MHz" + GIGAHERTZ = "GHz" + + FREQUENCY_HERTZ: Final = "Hz" +"""Deprecated: please use UnitOfFrequency.HERTZ""" FREQUENCY_KILOHERTZ: Final = "kHz" +"""Deprecated: please use UnitOfFrequency.KILOHERTZ""" FREQUENCY_MEGAHERTZ: Final = "MHz" +"""Deprecated: please use UnitOfFrequency.MEGAHERTZ""" FREQUENCY_GIGAHERTZ: Final = "GHz" +"""Deprecated: please use UnitOfFrequency.GIGAHERTZ""" # Pressure units