Use UnitOfMass in integrations (#83930)

This commit is contained in:
epenet 2022-12-14 16:37:11 +01:00 committed by GitHub
parent c0a7934828
commit ae9506d0bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View file

@ -16,7 +16,7 @@ from homeassistant.components.sensor import (
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import MASS_POUNDS, PERCENTAGE
from homeassistant.const import PERCENTAGE, UnitOfMass
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import EntityCategory
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -140,7 +140,7 @@ ROBOT_SENSOR_MAP: dict[type[Robot], list[RobotSensorEntityDescription]] = {
RobotSensorEntityDescription[LitterRobot4](
key="pet_weight",
name="Pet weight",
native_unit_of_measurement=MASS_POUNDS,
native_unit_of_measurement=UnitOfMass.POUNDS,
device_class=SensorDeviceClass.WEIGHT,
state_class=SensorStateClass.MEASUREMENT,
),