Add and use percentage constant (#32094)

* Add and use percentage constant

* Fix pylint error and broken test
This commit is contained in:
springstan 2020-02-28 20:46:48 +01:00 committed by GitHub
parent c7f128f286
commit f1a0ca7cd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
155 changed files with 735 additions and 459 deletions

View file

@ -7,13 +7,14 @@ from homeassistant.const import (
POWER_WATT,
TEMP_CELSIUS,
TEMP_FAHRENHEIT,
UNIT_PERCENTAGE,
)
SENSORS = {
"V_TEMP": [None, "mdi:thermometer"],
"V_HUM": ["%", "mdi:water-percent"],
"V_DIMMER": ["%", "mdi:percent"],
"V_PERCENTAGE": ["%", "mdi:percent"],
"V_HUM": [UNIT_PERCENTAGE, "mdi:water-percent"],
"V_DIMMER": [UNIT_PERCENTAGE, "mdi:percent"],
"V_PERCENTAGE": [UNIT_PERCENTAGE, "mdi:percent"],
"V_PRESSURE": [None, "mdi:gauge"],
"V_FORECAST": [None, "mdi:weather-partly-cloudy"],
"V_RAIN": [None, "mdi:weather-rainy"],
@ -26,7 +27,7 @@ SENSORS = {
"V_IMPEDANCE": ["ohm", None],
"V_WATT": [POWER_WATT, None],
"V_KWH": [ENERGY_KILO_WATT_HOUR, None],
"V_LIGHT_LEVEL": ["%", "mdi:white-balance-sunny"],
"V_LIGHT_LEVEL": [UNIT_PERCENTAGE, "mdi:white-balance-sunny"],
"V_FLOW": ["m", "mdi:gauge"],
"V_VOLUME": ["", None],
"V_LEVEL": {