From fbffea6b6131898b36711dc0f29660255fcdf7f6 Mon Sep 17 00:00:00 2001 From: Kendell R Date: Fri, 29 Jan 2021 10:22:44 -0800 Subject: [PATCH] Add unit of measurement and icon for sleep score (#45705) --- homeassistant/components/withings/common.py | 4 ++-- homeassistant/components/withings/const.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/withings/common.py b/homeassistant/components/withings/common.py index 52e22f9501a..c08ddddf4a5 100644 --- a/homeassistant/components/withings/common.py +++ b/homeassistant/components/withings/common.py @@ -402,8 +402,8 @@ WITHINGS_ATTRIBUTES = [ Measurement.SLEEP_SCORE, GetSleepSummaryField.SLEEP_SCORE, "Sleep score", - "", - None, + const.SCORE_POINTS, + "mdi:medal", SENSOR_DOMAIN, False, UpdateType.POLL, diff --git a/homeassistant/components/withings/const.py b/homeassistant/components/withings/const.py index c6cad929f81..d88f4e38c6a 100644 --- a/homeassistant/components/withings/const.py +++ b/homeassistant/components/withings/const.py @@ -55,6 +55,7 @@ class Measurement(Enum): WEIGHT_KG = "weight_kg" +SCORE_POINTS = "points" UOM_BEATS_PER_MINUTE = "bpm" UOM_BREATHS_PER_MINUTE = f"br/{const.TIME_MINUTES}" UOM_FREQUENCY = "times"