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
155 changed files with 735 additions and 459 deletions

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"],