mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Use SensorDeviceClass.WEIGHT in components (#79277)
This commit is contained in:
parent
fab3ee90b2
commit
c527defe31
@ -145,14 +145,14 @@ SENSOR_DESCRIPTIONS = {
|
|||||||
# Used for mass sensor with kg unit
|
# Used for mass sensor with kg unit
|
||||||
(BTHomeSensorDeviceClass.MASS, Units.MASS_KILOGRAMS): SensorEntityDescription(
|
(BTHomeSensorDeviceClass.MASS, Units.MASS_KILOGRAMS): SensorEntityDescription(
|
||||||
key=f"{BTHomeSensorDeviceClass.MASS}_{Units.MASS_KILOGRAMS}",
|
key=f"{BTHomeSensorDeviceClass.MASS}_{Units.MASS_KILOGRAMS}",
|
||||||
device_class=None,
|
device_class=SensorDeviceClass.WEIGHT,
|
||||||
native_unit_of_measurement=MASS_KILOGRAMS,
|
native_unit_of_measurement=MASS_KILOGRAMS,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
# Used for mass sensor with lb unit
|
# Used for mass sensor with lb unit
|
||||||
(BTHomeSensorDeviceClass.MASS, Units.MASS_POUNDS): SensorEntityDescription(
|
(BTHomeSensorDeviceClass.MASS, Units.MASS_POUNDS): SensorEntityDescription(
|
||||||
key=f"{BTHomeSensorDeviceClass.MASS}_{Units.MASS_POUNDS}",
|
key=f"{BTHomeSensorDeviceClass.MASS}_{Units.MASS_POUNDS}",
|
||||||
device_class=None,
|
device_class=SensorDeviceClass.WEIGHT,
|
||||||
native_unit_of_measurement=MASS_POUNDS,
|
native_unit_of_measurement=MASS_POUNDS,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
|
@ -111,6 +111,7 @@ ROBOT_SENSOR_MAP: dict[type[Robot], list[RobotSensorEntityDescription]] = {
|
|||||||
name="Pet weight",
|
name="Pet weight",
|
||||||
icon="mdi:scale",
|
icon="mdi:scale",
|
||||||
native_unit_of_measurement=MASS_POUNDS,
|
native_unit_of_measurement=MASS_POUNDS,
|
||||||
|
device_class=SensorDeviceClass.WEIGHT,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
FeederRobot: [
|
FeederRobot: [
|
||||||
|
@ -94,6 +94,7 @@ SENSORS: dict[str, SensorEntityDescription] = {
|
|||||||
"V_WEIGHT": SensorEntityDescription(
|
"V_WEIGHT": SensorEntityDescription(
|
||||||
key="V_WEIGHT",
|
key="V_WEIGHT",
|
||||||
native_unit_of_measurement=MASS_KILOGRAMS,
|
native_unit_of_measurement=MASS_KILOGRAMS,
|
||||||
|
device_class=SensorDeviceClass.WEIGHT,
|
||||||
icon="mdi:weight-kilogram",
|
icon="mdi:weight-kilogram",
|
||||||
),
|
),
|
||||||
"V_DISTANCE": SensorEntityDescription(
|
"V_DISTANCE": SensorEntityDescription(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user