Use SensorDeviceClass.WEIGHT in components (#79277)
parent
fab3ee90b2
commit
c527defe31
|
@ -145,14 +145,14 @@ SENSOR_DESCRIPTIONS = {
|
|||
# Used for mass sensor with kg unit
|
||||
(BTHomeSensorDeviceClass.MASS, Units.MASS_KILOGRAMS): SensorEntityDescription(
|
||||
key=f"{BTHomeSensorDeviceClass.MASS}_{Units.MASS_KILOGRAMS}",
|
||||
device_class=None,
|
||||
device_class=SensorDeviceClass.WEIGHT,
|
||||
native_unit_of_measurement=MASS_KILOGRAMS,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
# Used for mass sensor with lb unit
|
||||
(BTHomeSensorDeviceClass.MASS, Units.MASS_POUNDS): SensorEntityDescription(
|
||||
key=f"{BTHomeSensorDeviceClass.MASS}_{Units.MASS_POUNDS}",
|
||||
device_class=None,
|
||||
device_class=SensorDeviceClass.WEIGHT,
|
||||
native_unit_of_measurement=MASS_POUNDS,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
|
|
|
@ -111,6 +111,7 @@ ROBOT_SENSOR_MAP: dict[type[Robot], list[RobotSensorEntityDescription]] = {
|
|||
name="Pet weight",
|
||||
icon="mdi:scale",
|
||||
native_unit_of_measurement=MASS_POUNDS,
|
||||
device_class=SensorDeviceClass.WEIGHT,
|
||||
),
|
||||
],
|
||||
FeederRobot: [
|
||||
|
|
|
@ -94,6 +94,7 @@ SENSORS: dict[str, SensorEntityDescription] = {
|
|||
"V_WEIGHT": SensorEntityDescription(
|
||||
key="V_WEIGHT",
|
||||
native_unit_of_measurement=MASS_KILOGRAMS,
|
||||
device_class=SensorDeviceClass.WEIGHT,
|
||||
icon="mdi:weight-kilogram",
|
||||
),
|
||||
"V_DISTANCE": SensorEntityDescription(
|
||||
|
|
Loading…
Reference in New Issue