Use SensorDeviceClass.WEIGHT in components (#79277)

This commit is contained in:
epenet 2022-09-29 11:28:59 +02:00 committed by GitHub
parent fab3ee90b2
commit c527defe31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

View File

@ -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,
),

View File

@ -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: [

View File

@ -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(