Drop UNIT_ prefix for percentage constant (#39383)

This commit is contained in:
springstan 2020-09-05 21:09:14 +02:00 committed by GitHub
parent cdc93d7110
commit d2b1918e9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
183 changed files with 639 additions and 661 deletions

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",