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
@@ -15,6 +15,7 @@ from homeassistant.const import (
|
||||
DEVICE_CLASS_BATTERY,
|
||||
DEVICE_CLASS_HUMIDITY,
|
||||
DEVICE_CLASS_TEMPERATURE,
|
||||
UNIT_PERCENTAGE,
|
||||
)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import Entity
|
||||
@@ -46,8 +47,8 @@ DEFAULT_TIMEOUT = 10
|
||||
# Sensor types are defined like: Name, units
|
||||
SENSOR_TYPES = {
|
||||
"temperature": [DEVICE_CLASS_TEMPERATURE, "Temperature", "°C"],
|
||||
"humidity": [DEVICE_CLASS_HUMIDITY, "Humidity", "%"],
|
||||
"battery": [DEVICE_CLASS_BATTERY, "Battery", "%"],
|
||||
"humidity": [DEVICE_CLASS_HUMIDITY, "Humidity", UNIT_PERCENTAGE],
|
||||
"battery": [DEVICE_CLASS_BATTERY, "Battery", UNIT_PERCENTAGE],
|
||||
}
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
|
||||
Reference in new issue
Block a user