diff --git a/homeassistant/components/garmin_connect/const.py b/homeassistant/components/garmin_connect/const.py index ae1c2f1caa1..3b8d99c486a 100644 --- a/homeassistant/components/garmin_connect/const.py +++ b/homeassistant/components/garmin_connect/const.py @@ -1,5 +1,10 @@ """Constants for the Garmin Connect integration.""" -from homeassistant.const import DEVICE_CLASS_TIMESTAMP, TIME_MINUTES, UNIT_PERCENTAGE +from homeassistant.const import ( + DEVICE_CLASS_TIMESTAMP, + MASS_KILOGRAMS, + TIME_MINUTES, + UNIT_PERCENTAGE, +) DOMAIN = "garmin_connect" ATTRIBUTION = "Data provided by garmin.com" @@ -309,12 +314,12 @@ GARMIN_ENTITY_LIST = { DEVICE_CLASS_TIMESTAMP, False, ], - "weight": ["Weight", "kg", "mdi:weight-kilogram", None, False], + "weight": ["Weight", MASS_KILOGRAMS, "mdi:weight-kilogram", None, False], "bmi": ["BMI", "", "mdi:food", None, False], "bodyFat": ["Body Fat", UNIT_PERCENTAGE, "mdi:food", None, False], "bodyWater": ["Body Water", UNIT_PERCENTAGE, "mdi:water-percent", None, False], - "bodyMass": ["Body Mass", "kg", "mdi:food", None, False], - "muscleMass": ["Muscle Mass", "kg", "mdi:dumbbell", None, False], + "bodyMass": ["Body Mass", MASS_KILOGRAMS, "mdi:food", None, False], + "muscleMass": ["Muscle Mass", MASS_KILOGRAMS, "mdi:dumbbell", None, False], "physiqueRating": ["Physique Rating", "", "mdi:numeric", None, False], "visceralFat": ["Visceral Fat", "", "mdi:food", None, False], "metabolicAge": ["Metabolic Age", "", "mdi:calendar-heart", None, False], diff --git a/homeassistant/components/isy994/sensor.py b/homeassistant/components/isy994/sensor.py index d3a889902f5..c8c427a5bf5 100644 --- a/homeassistant/components/isy994/sensor.py +++ b/homeassistant/components/isy994/sensor.py @@ -6,6 +6,7 @@ from homeassistant.components.sensor import DOMAIN from homeassistant.const import ( CONCENTRATION_PARTS_PER_MILLION, LENGTH_KILOMETERS, + MASS_KILOGRAMS, POWER_WATT, SPEED_KILOMETERS_PER_HOUR, SPEED_METERS_PER_SECOND, @@ -55,7 +56,7 @@ UOM_FRIENDLY_NAME = { "25": "index", "26": "K", "27": "keyword", - "28": "kg", + "28": MASS_KILOGRAMS, "29": "kV", "30": "kW", "31": "kPa", diff --git a/homeassistant/components/smartthings/sensor.py b/homeassistant/components/smartthings/sensor.py index da581bb969e..b25b89ac9cf 100644 --- a/homeassistant/components/smartthings/sensor.py +++ b/homeassistant/components/smartthings/sensor.py @@ -41,7 +41,7 @@ CAPABILITY_TO_SENSORS = { Map(Attribute.battery, "Battery", UNIT_PERCENTAGE, DEVICE_CLASS_BATTERY) ], Capability.body_mass_index_measurement: [ - Map(Attribute.bmi_measurement, "Body Mass Index", "kg/m^2", None) + Map(Attribute.bmi_measurement, "Body Mass Index", f"{MASS_KILOGRAMS}/m^2", None) ], Capability.body_weight_measurement: [ Map(Attribute.body_weight_measurement, "Body Weight", MASS_KILOGRAMS, None)