mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 08:17:08 +00:00
Migrate temperature units to an enum (#81006)
* Migrate temperature units to an enum * Adjust spacing
This commit is contained in:
parent
9ee4d77935
commit
e0d94d799a
@ -520,10 +520,22 @@ CURRENCY_EURO: Final = "€"
|
||||
CURRENCY_DOLLAR: Final = "$"
|
||||
CURRENCY_CENT: Final = "¢"
|
||||
|
||||
|
||||
# Temperature units
|
||||
class UnitOfTemperature(StrEnum):
|
||||
"""Temperature units."""
|
||||
|
||||
CELSIUS = "°C"
|
||||
FAHRENHEIT = "°F"
|
||||
KELVIN = "K"
|
||||
|
||||
|
||||
TEMP_CELSIUS: Final = "°C"
|
||||
"""Deprecated: please use UnitOfTemperature.CELSIUS"""
|
||||
TEMP_FAHRENHEIT: Final = "°F"
|
||||
"""Deprecated: please use UnitOfTemperature.FAHRENHEIT"""
|
||||
TEMP_KELVIN: Final = "K"
|
||||
"""Deprecated: please use UnitOfTemperature.KELVIN"""
|
||||
|
||||
# Time units
|
||||
TIME_MICROSECONDS: Final = "μs"
|
||||
|
Loading…
x
Reference in New Issue
Block a user