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 -2
View File
@@ -18,6 +18,7 @@ from homeassistant.const import (
MASS_MILLIGRAMS,
TIME_MILLISECONDS,
TIME_MINUTES,
UNIT_PERCENTAGE,
)
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
@@ -91,11 +92,11 @@ FITBIT_RESOURCES_LIST = {
],
"activities/tracker/steps": ["Tracker Steps", "steps", "walk"],
"body/bmi": ["BMI", "BMI", "human"],
"body/fat": ["Body Fat", "%", "human"],
"body/fat": ["Body Fat", UNIT_PERCENTAGE, "human"],
"body/weight": ["Weight", "", "human"],
"devices/battery": ["Battery", None, None],
"sleep/awakeningsCount": ["Awakenings Count", "times awaken", "sleep"],
"sleep/efficiency": ["Sleep Efficiency", "%", "sleep"],
"sleep/efficiency": ["Sleep Efficiency", UNIT_PERCENTAGE, "sleep"],
"sleep/minutesAfterWakeup": ["Minutes After Wakeup", TIME_MINUTES, "sleep"],
"sleep/minutesAsleep": ["Sleep Minutes Asleep", TIME_MINUTES, "sleep"],
"sleep/minutesAwake": ["Sleep Minutes Awake", TIME_MINUTES, "sleep"],