mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 10:47:10 +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:
parent
38f62ae622
commit
96c442349f
@ -27,6 +27,7 @@ from homeassistant.const import (
|
|||||||
ATTR_UNIT_OF_MEASUREMENT,
|
ATTR_UNIT_OF_MEASUREMENT,
|
||||||
REVOLUTIONS_PER_MINUTE,
|
REVOLUTIONS_PER_MINUTE,
|
||||||
UnitOfIrradiance,
|
UnitOfIrradiance,
|
||||||
|
UnitOfSoundPressure,
|
||||||
UnitOfVolume,
|
UnitOfVolume,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant, State, callback, split_entity_id
|
from homeassistant.core import HomeAssistant, State, callback, split_entity_id
|
||||||
@ -55,6 +56,7 @@ DEFAULT_STATISTICS = {
|
|||||||
|
|
||||||
EQUIVALENT_UNITS = {
|
EQUIVALENT_UNITS = {
|
||||||
"BTU/(h×ft²)": UnitOfIrradiance.BTUS_PER_HOUR_SQUARE_FOOT,
|
"BTU/(h×ft²)": UnitOfIrradiance.BTUS_PER_HOUR_SQUARE_FOOT,
|
||||||
|
"dBa": UnitOfSoundPressure.WEIGHTED_DECIBEL_A,
|
||||||
"RPM": REVOLUTIONS_PER_MINUTE,
|
"RPM": REVOLUTIONS_PER_MINUTE,
|
||||||
"ft3": UnitOfVolume.CUBIC_FEET,
|
"ft3": UnitOfVolume.CUBIC_FEET,
|
||||||
"m3": UnitOfVolume.CUBIC_METERS,
|
"m3": UnitOfVolume.CUBIC_METERS,
|
||||||
|
@ -702,9 +702,19 @@ PRESSURE_INHG: Final = "inHg"
|
|||||||
PRESSURE_PSI: Final = "psi"
|
PRESSURE_PSI: Final = "psi"
|
||||||
"""Deprecated: please use UnitOfPressure.PSI"""
|
"""Deprecated: please use UnitOfPressure.PSI"""
|
||||||
|
|
||||||
|
|
||||||
# Sound pressure units
|
# Sound pressure units
|
||||||
|
class UnitOfSoundPressure(StrEnum):
|
||||||
|
"""Sound pressure units."""
|
||||||
|
|
||||||
|
DECIBEL = "dB"
|
||||||
|
WEIGHTED_DECIBEL_A = "dBA"
|
||||||
|
|
||||||
|
|
||||||
SOUND_PRESSURE_DB: Final = "dB"
|
SOUND_PRESSURE_DB: Final = "dB"
|
||||||
|
"""Deprecated: please use UnitOfSoundPressure.DECIBEL"""
|
||||||
SOUND_PRESSURE_WEIGHTED_DBA: Final = "dBa"
|
SOUND_PRESSURE_WEIGHTED_DBA: Final = "dBa"
|
||||||
|
"""Deprecated: please use UnitOfSoundPressure.WEIGHTED_DECIBEL_A"""
|
||||||
|
|
||||||
|
|
||||||
# Volume units
|
# Volume units
|
||||||
|
Loading…
x
Reference in New Issue
Block a user