1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Introduce unit enums for sound pressure (#83450)

* Introduce unit enums for sound pressure

* Adjust based on architecture comment

* Adjust
This commit is contained in:
epenet
2022-12-08 20:06:02 +01:00
committed by GitHub
parent 38f62ae622
commit 96c442349f
2 changed files with 12 additions and 0 deletions

View File

@@ -702,9 +702,19 @@ PRESSURE_INHG: Final = "inHg"
PRESSURE_PSI: Final = "psi"
"""Deprecated: please use UnitOfPressure.PSI"""
# Sound pressure units
class UnitOfSoundPressure(StrEnum):
"""Sound pressure units."""
DECIBEL = "dB"
WEIGHTED_DECIBEL_A = "dBA"
SOUND_PRESSURE_DB: Final = "dB"
"""Deprecated: please use UnitOfSoundPressure.DECIBEL"""
SOUND_PRESSURE_WEIGHTED_DBA: Final = "dBa"
"""Deprecated: please use UnitOfSoundPressure.WEIGHTED_DECIBEL_A"""
# Volume units