Add and use percentage constant (#32094)

* Add and use percentage constant

* Fix pylint error and broken test
This commit is contained in:
springstan authored and GitHub committed 2020-02-28 11:46:48 -08:00
1 parent c7f128f286
commit f1a0ca7cd3
155 files changed
+735 -459

No files matched your search

+3 -3
View File
@@ -1,7 +1,7 @@
"""Support for Canary sensors."""
from canary.api import SensorType
from homeassistant.const import TEMP_CELSIUS
from homeassistant.const import TEMP_CELSIUS, UNIT_PERCENTAGE
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.icon import icon_for_battery_level
@@ -14,10 +14,10 @@ ATTR_AIR_QUALITY = "air_quality"
# sensor type name, unit_of_measurement, icon
SENSOR_TYPES = [
["temperature", TEMP_CELSIUS, "mdi:thermometer", ["Canary"]],
["humidity", "%", "mdi:water-percent", ["Canary"]],
["humidity", UNIT_PERCENTAGE, "mdi:water-percent", ["Canary"]],
["air_quality", None, "mdi:weather-windy", ["Canary"]],
["wifi", "dBm", "mdi:wifi", ["Canary Flex"]],
["battery", "%", "mdi:battery-50", ["Canary Flex"]],
["battery", UNIT_PERCENTAGE, "mdi:battery-50", ["Canary Flex"]],
]
STATE_AIR_QUALITY_NORMAL = "normal"