mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 01:08:12 +00:00
Use MASS_KILOGRAMS constant (#34052)
This commit is contained in:
parent
b160f1c813
commit
d454c6a43d
@ -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],
|
||||
|
@ -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",
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user