Use UnitOfEnergy.KILO_CALORIE in Tractive integration (#131909)
parent
790edea4a0
commit
2a127d19dd
|
@ -16,6 +16,7 @@ from homeassistant.const import (
|
|||
ATTR_BATTERY_LEVEL,
|
||||
PERCENTAGE,
|
||||
EntityCategory,
|
||||
UnitOfEnergy,
|
||||
UnitOfTime,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
|
@ -127,7 +128,7 @@ SENSOR_TYPES: tuple[TractiveSensorEntityDescription, ...] = (
|
|||
TractiveSensorEntityDescription(
|
||||
key=ATTR_CALORIES,
|
||||
translation_key="calories",
|
||||
native_unit_of_measurement="kcal",
|
||||
native_unit_of_measurement=UnitOfEnergy.KILO_CALORIE,
|
||||
signal_prefix=TRACKER_WELLNESS_STATUS_UPDATED,
|
||||
state_class=SensorStateClass.TOTAL,
|
||||
),
|
||||
|
|
|
@ -139,7 +139,7 @@
|
|||
'supported_features': 0,
|
||||
'translation_key': 'calories',
|
||||
'unique_id': 'pet_id_123_calories',
|
||||
'unit_of_measurement': 'kcal',
|
||||
'unit_of_measurement': <UnitOfEnergy.KILO_CALORIE: 'kcal'>,
|
||||
})
|
||||
# ---
|
||||
# name: test_sensor[sensor.test_pet_calories_burned-state]
|
||||
|
@ -147,7 +147,7 @@
|
|||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Test Pet Calories burned',
|
||||
'state_class': <SensorStateClass.TOTAL: 'total'>,
|
||||
'unit_of_measurement': 'kcal',
|
||||
'unit_of_measurement': <UnitOfEnergy.KILO_CALORIE: 'kcal'>,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.test_pet_calories_burned',
|
||||
|
|
Loading…
Reference in New Issue