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
2020-09-23 04:09:17 +02:00
committed by GitHub
parent 511ea09c99
commit 06a133c3e9
17 changed files with 98 additions and 57 deletions

View File

@@ -5,6 +5,7 @@ from homeassistant.const import (
LENGTH_FEET,
LENGTH_INCHES,
LENGTH_METERS,
LENGTH_MILLIMETERS,
PERCENTAGE,
SPEED_KILOMETERS_PER_HOUR,
SPEED_MILES_PER_HOUR,
@@ -24,7 +25,6 @@ ATTR_UNIT_METRIC = "Metric"
CONCENTRATION_PARTS_PER_CUBIC_METER = f"p/{VOLUME_CUBIC_METERS}"
COORDINATOR = "coordinator"
DOMAIN = "accuweather"
LENGTH_MILIMETERS = "mm"
MANUFACTURER = "AccuWeather, Inc."
NAME = "AccuWeather"
UNDO_UPDATE_LISTENER = "undo_update_listener"
@@ -238,7 +238,7 @@ SENSOR_TYPES = {
ATTR_DEVICE_CLASS: None,
ATTR_ICON: "mdi:weather-rainy",
ATTR_LABEL: "Precipitation",
ATTR_UNIT_METRIC: LENGTH_MILIMETERS,
ATTR_UNIT_METRIC: LENGTH_MILLIMETERS,
ATTR_UNIT_IMPERIAL: LENGTH_INCHES,
},
"PressureTendency": {