Add and use percentage constant (#32094)
* Add and use percentage constant * Fix pylint error and broken test
This commit is contained in:
parent
c7f128f286
commit
f1a0ca7cd3
155 changed files with 735 additions and 459 deletions
|
@ -7,7 +7,12 @@ from sense_hat import SenseHat
|
|||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
from homeassistant.const import CONF_DISPLAY_OPTIONS, CONF_NAME, TEMP_CELSIUS
|
||||
from homeassistant.const import (
|
||||
CONF_DISPLAY_OPTIONS,
|
||||
CONF_NAME,
|
||||
TEMP_CELSIUS,
|
||||
UNIT_PERCENTAGE,
|
||||
)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.util import Throttle
|
||||
|
@ -21,7 +26,7 @@ MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=60)
|
|||
|
||||
SENSOR_TYPES = {
|
||||
"temperature": ["temperature", TEMP_CELSIUS],
|
||||
"humidity": ["humidity", "%"],
|
||||
"humidity": ["humidity", UNIT_PERCENTAGE],
|
||||
"pressure": ["pressure", "mb"],
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue