From b97f95efc4690fd97170e4096be97a7916c11e6f Mon Sep 17 00:00:00 2001 From: Alice Date: Mon, 5 Dec 2022 10:12:58 -0600 Subject: [PATCH] Update litterrobot integration to support long-term statistics (#83269) --- homeassistant/components/litterrobot/sensor.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/homeassistant/components/litterrobot/sensor.py b/homeassistant/components/litterrobot/sensor.py index 1857931143d..a65781db358 100644 --- a/homeassistant/components/litterrobot/sensor.py +++ b/homeassistant/components/litterrobot/sensor.py @@ -13,6 +13,7 @@ from homeassistant.components.sensor import ( SensorDeviceClass, SensorEntity, SensorEntityDescription, + SensorStateClass, ) from homeassistant.config_entries import ConfigEntry from homeassistant.const import MASS_POUNDS, PERCENTAGE @@ -73,6 +74,7 @@ ROBOT_SENSOR_MAP: dict[type[Robot], list[RobotSensorEntityDescription]] = { name="Waste Drawer", native_unit_of_measurement=PERCENTAGE, icon_fn=lambda state: icon_for_gauge_level(state, 10), + state_class=SensorStateClass.MEASUREMENT, ), RobotSensorEntityDescription[LitterRobot]( key="sleep_mode_start_time", @@ -105,12 +107,14 @@ ROBOT_SENSOR_MAP: dict[type[Robot], list[RobotSensorEntityDescription]] = { name="Litter level", native_unit_of_measurement=PERCENTAGE, icon_fn=lambda state: icon_for_gauge_level(state, 10), + state_class=SensorStateClass.MEASUREMENT, ), RobotSensorEntityDescription[LitterRobot4]( key="pet_weight", name="Pet weight", native_unit_of_measurement=MASS_POUNDS, device_class=SensorDeviceClass.WEIGHT, + state_class=SensorStateClass.MEASUREMENT, ), ], FeederRobot: [ @@ -119,6 +123,7 @@ ROBOT_SENSOR_MAP: dict[type[Robot], list[RobotSensorEntityDescription]] = { name="Food level", native_unit_of_measurement=PERCENTAGE, icon_fn=lambda state: icon_for_gauge_level(state, 10), + state_class=SensorStateClass.MEASUREMENT, ) ], }