From a8d587bc5379c0d3aad0174f20734b02fb39e78f Mon Sep 17 00:00:00 2001 From: landaisbenj <32144431+landaisbenj@users.noreply.github.com> Date: Mon, 27 Feb 2023 11:52:07 +0100 Subject: [PATCH] Add state_class to qbittorent sensors (#88829) Update Sensor.py on qbittorent integration Add stat class fonctionnality to sensor speed. --- homeassistant/components/qbittorrent/sensor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/homeassistant/components/qbittorrent/sensor.py b/homeassistant/components/qbittorrent/sensor.py index 14bc0eb2ed9..e7b75954d52 100644 --- a/homeassistant/components/qbittorrent/sensor.py +++ b/homeassistant/components/qbittorrent/sensor.py @@ -12,6 +12,7 @@ from homeassistant.components.sensor import ( SensorDeviceClass, SensorEntity, SensorEntityDescription, + SensorStateClass, ) from homeassistant.const import ( CONF_NAME, @@ -45,12 +46,14 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = ( name="Down Speed", device_class=SensorDeviceClass.DATA_RATE, native_unit_of_measurement=UnitOfDataRate.KIBIBYTES_PER_SECOND, + state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( key=SENSOR_TYPE_UPLOAD_SPEED, name="Up Speed", device_class=SensorDeviceClass.DATA_RATE, native_unit_of_measurement=UnitOfDataRate.KIBIBYTES_PER_SECOND, + state_class=SensorStateClass.MEASUREMENT, ), )