mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Migrate precipitation units to an enum (#81143)
This commit is contained in:
parent
621068211f
commit
697b5db3f2
@ -743,15 +743,27 @@ class UnitOfVolumetricFlux(StrEnum):
|
|||||||
"""Derived from mm³/(mm².h)"""
|
"""Derived from mm³/(mm².h)"""
|
||||||
|
|
||||||
|
|
||||||
# Precipitation units
|
class UnitOfPrecipitationDepth(StrEnum):
|
||||||
# The derivation of these units is a volume of rain amassing in a container
|
"""Precipitation depth.
|
||||||
# with constant cross section
|
|
||||||
PRECIPITATION_INCHES: Final = "in"
|
|
||||||
PRECIPITATION_MILLIMETERS: Final = "mm"
|
|
||||||
|
|
||||||
|
The derivation of these units is a volume of rain amassing in a container
|
||||||
|
with constant cross section
|
||||||
|
"""
|
||||||
|
|
||||||
|
INCHES = "in"
|
||||||
|
"""Derived from in³/in²"""
|
||||||
|
|
||||||
|
MILLIMETERS = "mm"
|
||||||
|
"""Derived from mm³/mm²"""
|
||||||
|
|
||||||
|
|
||||||
|
# Precipitation units
|
||||||
|
PRECIPITATION_INCHES: Final = "in"
|
||||||
|
"""Deprecated: please use UnitOfPrecipitationDepth.INCHES"""
|
||||||
|
PRECIPITATION_MILLIMETERS: Final = "mm"
|
||||||
|
"""Deprecated: please use UnitOfPrecipitationDepth.MILLIMETERS"""
|
||||||
PRECIPITATION_MILLIMETERS_PER_HOUR: Final = "mm/h"
|
PRECIPITATION_MILLIMETERS_PER_HOUR: Final = "mm/h"
|
||||||
"""Deprecated: please use UnitOfVolumetricFlux.MILLIMETERS_PER_HOUR"""
|
"""Deprecated: please use UnitOfVolumetricFlux.MILLIMETERS_PER_HOUR"""
|
||||||
|
|
||||||
PRECIPITATION_INCHES_PER_HOUR: Final = "in/h"
|
PRECIPITATION_INCHES_PER_HOUR: Final = "in/h"
|
||||||
"""Deprecated: please use UnitOfVolumetricFlux.INCHES_PER_HOUR"""
|
"""Deprecated: please use UnitOfVolumetricFlux.INCHES_PER_HOUR"""
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user