Add and use percentage constant (#32094)
* Add and use percentage constant * Fix pylint error and broken test
This commit is contained in:
1 parent
c7f128f286
commit
f1a0ca7cd3
155 files changed
+735
-459
No files matched your search
@@ -8,7 +8,12 @@ import smbus # pylint: disable=import-error
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
from homeassistant.const import CONF_MONITORED_CONDITIONS, CONF_NAME, TEMP_FAHRENHEIT
|
||||
from homeassistant.const import (
|
||||
CONF_MONITORED_CONDITIONS,
|
||||
CONF_NAME,
|
||||
TEMP_FAHRENHEIT,
|
||||
UNIT_PERCENTAGE,
|
||||
)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.util import Throttle
|
||||
@@ -44,7 +49,7 @@ SENSOR_HUMID = "humidity"
|
||||
SENSOR_PRESS = "pressure"
|
||||
SENSOR_TYPES = {
|
||||
SENSOR_TEMP: ["Temperature", None],
|
||||
SENSOR_HUMID: ["Humidity", "%"],
|
||||
SENSOR_HUMID: ["Humidity", UNIT_PERCENTAGE],
|
||||
SENSOR_PRESS: ["Pressure", "mb"],
|
||||
}
|
||||
DEFAULT_MONITORED = [SENSOR_TEMP, SENSOR_HUMID, SENSOR_PRESS]
|
||||
|
||||
Reference in new issue
Block a user