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
@@ -17,6 +17,7 @@ from homeassistant.const import (
|
||||
CONF_USERNAME,
|
||||
TEMP_CELSIUS,
|
||||
TIME_SECONDS,
|
||||
UNIT_PERCENTAGE,
|
||||
)
|
||||
from homeassistant.exceptions import PlatformNotReady
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
@@ -37,7 +38,7 @@ SENSOR_TYPES = {
|
||||
"time": [ATTR_TIME, TIME_SECONDS],
|
||||
"pm": [ATTR_PM2_5, CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, "mdi:cloud"],
|
||||
"tmp": [ATTR_TEMPERATURE, TEMP_CELSIUS, "mdi:thermometer"],
|
||||
"hum": [ATTR_HUMIDITY, "%", "mdi:water-percent"],
|
||||
"hum": [ATTR_HUMIDITY, UNIT_PERCENTAGE, "mdi:water-percent"],
|
||||
"co2": [
|
||||
ATTR_CARBON_DIOXIDE,
|
||||
CONCENTRATION_PARTS_PER_MILLION,
|
||||
@@ -48,7 +49,7 @@ SENSOR_TYPES = {
|
||||
CONCENTRATION_PARTS_PER_BILLION,
|
||||
"mdi:cloud",
|
||||
],
|
||||
"allpollu": [ATTR_FOOBOT_INDEX, "%", "mdi:percent"],
|
||||
"allpollu": [ATTR_FOOBOT_INDEX, UNIT_PERCENTAGE, "mdi:percent"],
|
||||
}
|
||||
|
||||
SCAN_INTERVAL = timedelta(minutes=10)
|
||||
|
||||
Reference in new issue
Block a user