mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Introduce unit enums for irradiance (#83414)
This commit is contained in:
@@ -787,9 +787,20 @@ PERCENTAGE: Final = "%"
|
||||
# Rotational speed units
|
||||
REVOLUTIONS_PER_MINUTE: Final = "rpm"
|
||||
|
||||
|
||||
# Irradiance units
|
||||
class UnitOfIrradiance(StrEnum):
|
||||
"""Irradiance units."""
|
||||
|
||||
WATTS_PER_SQUARE_METER = "W/m²"
|
||||
BTUS_PER_HOUR_SQUARE_FOOT = "BTU/(h⋅ft²)"
|
||||
|
||||
|
||||
# Irradiation units
|
||||
IRRADIATION_WATTS_PER_SQUARE_METER: Final = "W/m²"
|
||||
"""Deprecated: please use UnitOfIrradiance.WATTS_PER_SQUARE_METER"""
|
||||
IRRADIATION_BTUS_PER_HOUR_SQUARE_FOOT: Final = "BTU/(h×ft²)"
|
||||
"""Deprecated: please use UnitOfIrradiance.BTUS_PER_HOUR_SQUARE_FOOT"""
|
||||
|
||||
|
||||
class UnitOfVolumetricFlux(StrEnum):
|
||||
@@ -800,16 +811,16 @@ class UnitOfVolumetricFlux(StrEnum):
|
||||
"""
|
||||
|
||||
INCHES_PER_DAY = "in/d"
|
||||
"""Derived from in³/(in².d)"""
|
||||
"""Derived from in³/(in²⋅d)"""
|
||||
|
||||
INCHES_PER_HOUR = "in/h"
|
||||
"""Derived from in³/(in².h)"""
|
||||
"""Derived from in³/(in²⋅h)"""
|
||||
|
||||
MILLIMETERS_PER_DAY = "mm/d"
|
||||
"""Derived from mm³/(mm².d)"""
|
||||
"""Derived from mm³/(mm²⋅d)"""
|
||||
|
||||
MILLIMETERS_PER_HOUR = "mm/h"
|
||||
"""Derived from mm³/(mm².h)"""
|
||||
"""Derived from mm³/(mm²⋅h)"""
|
||||
|
||||
|
||||
class UnitOfPrecipitationDepth(StrEnum):
|
||||
|
||||
Reference in New Issue
Block a user