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

+9 -4
View File
@@ -13,7 +13,12 @@ from withings_api.common import (
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import MASS_KILOGRAMS, SPEED_METERS_PER_SECOND, TIME_SECONDS
from homeassistant.const import (
MASS_KILOGRAMS,
SPEED_METERS_PER_SECOND,
TIME_SECONDS,
UNIT_PERCENTAGE,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_entry_oauth2_flow
from homeassistant.helpers.entity import Entity
@@ -150,7 +155,7 @@ WITHINGS_ATTRIBUTES = [
const.MEAS_FAT_RATIO_PCT,
MeasureType.FAT_RATIO,
"Fat Ratio",
const.UOM_PERCENT,
UNIT_PERCENTAGE,
None,
),
WithingsMeasureAttribute(
@@ -175,13 +180,13 @@ WITHINGS_ATTRIBUTES = [
"mdi:heart-pulse",
),
WithingsMeasureAttribute(
const.MEAS_SPO2_PCT, MeasureType.SP02, "SP02", const.UOM_PERCENT, None
const.MEAS_SPO2_PCT, MeasureType.SP02, "SP02", UNIT_PERCENTAGE, None
),
WithingsMeasureAttribute(
const.MEAS_HYDRATION,
MeasureType.HYDRATION,
"Hydration",
const.UOM_PERCENT,
UNIT_PERCENTAGE,
"mdi:water",
),
WithingsMeasureAttribute(