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

Add and use UNIT_DEGREE constant (#33978)

* Add and use UNIT_DEGREE constant

* Replace more occurrences

* Add and use TEMP_KELVIN

* Run isort
This commit is contained in:
springstan
2020-04-11 16:54:11 +02:00
committed by GitHub
parent c18a6d5ea3
commit b893150154
19 changed files with 67 additions and 47 deletions

View File

@@ -352,9 +352,13 @@ UNIT_VOLT = "V"
ENERGY_WATT_HOUR = f"{POWER_WATT}h"
ENERGY_KILO_WATT_HOUR = f"k{ENERGY_WATT_HOUR}"
# Degree units
UNIT_DEGREE = "°"
# Temperature units
TEMP_CELSIUS = "°C"
TEMP_FAHRENHEIT = "°F"
TEMP_CELSIUS = f"{UNIT_DEGREE}C"
TEMP_FAHRENHEIT = f"{UNIT_DEGREE}F"
TEMP_KELVIN = f"{UNIT_DEGREE}K"
# Time units
TIME_MICROSECONDS = "μs"
@@ -410,6 +414,7 @@ UNIT_UV_INDEX: str = "UV index"
# Percentage units
UNIT_PERCENTAGE = "%"
# Irradiation units
IRRADIATION_WATTS_PER_SQUARE_METER = f"{POWER_WATT}/{AREA_SQUARE_METERS}"