Add and use length millimeters constant (#40116)

* Add and use length millimeters constant

* Fix pylint error

* Fix broken accuweather sensor test
This commit is contained in:
springstan authored and GitHub committed 2020-09-22 21:09:17 -05:00
1 parent 511ea09c99
commit 06a133c3e9
17 files changed
+98 -57

No files matched your search

+4 -3
View File
@@ -12,6 +12,7 @@ from homeassistant.const import (
DEVICE_CLASS_PRESSURE,
DEVICE_CLASS_SIGNAL_STRENGTH,
DEVICE_CLASS_TEMPERATURE,
LENGTH_MILLIMETERS,
PERCENTAGE,
PRESSURE_MBAR,
SPEED_KILOMETERS_PER_HOUR,
@@ -52,9 +53,9 @@ SENSOR_TYPES = {
"pressure": ["Pressure", PRESSURE_MBAR, None, DEVICE_CLASS_PRESSURE],
"noise": ["Noise", "dB", "mdi:volume-high", None],
"humidity": ["Humidity", PERCENTAGE, None, DEVICE_CLASS_HUMIDITY],
"rain": ["Rain", "mm", "mdi:weather-rainy", None],
"sum_rain_1": ["Rain last hour", "mm", "mdi:weather-rainy", None],
"sum_rain_24": ["Rain last 24h", "mm", "mdi:weather-rainy", None],
"rain": ["Rain", LENGTH_MILLIMETERS, "mdi:weather-rainy", None],
"sum_rain_1": ["Rain last hour", LENGTH_MILLIMETERS, "mdi:weather-rainy", None],
"sum_rain_24": ["Rain last 24h", LENGTH_MILLIMETERS, "mdi:weather-rainy", None],
"battery_vp": ["Battery", "", "mdi:battery", None],
"battery_lvl": ["Battery Level", "", "mdi:battery", None],
"battery_percent": ["Battery Percent", PERCENTAGE, None, DEVICE_CLASS_BATTERY],