Drop UNIT_ prefix for percentage constant (#39383)

This commit is contained in:
springstan authored and GitHub committed 2020-09-05 21:09:14 +02:00
1 parent cdc93d7110
commit d2b1918e9c
183 files changed
+639 -661

No files matched your search

+3 -3
View File
@@ -6,9 +6,9 @@ import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_MONITORED_CONDITIONS,
PERCENTAGE,
TEMP_CELSIUS,
TEMP_FAHRENHEIT,
UNIT_PERCENTAGE,
)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
@@ -30,7 +30,7 @@ SENSOR_TYPES = [
# Sensor units - these do not currently align with the API documentation
SENSOR_UNITS_IMPERIAL = {
"Temperature": TEMP_FAHRENHEIT,
"Humidity": UNIT_PERCENTAGE,
"Humidity": PERCENTAGE,
"Pressure": "inHg",
"Luminance": "cd/m²",
"Voltage": "mV",
@@ -39,7 +39,7 @@ SENSOR_UNITS_IMPERIAL = {
# Metric units
SENSOR_UNITS_METRIC = {
"Temperature": TEMP_CELSIUS,
"Humidity": UNIT_PERCENTAGE,
"Humidity": PERCENTAGE,
"Pressure": "mbar",
"Luminance": "cd/m²",
"Voltage": "mV",