mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 11:47:06 +00:00
Add state_class to qbittorent sensors (#88829)
Update Sensor.py on qbittorent integration Add stat class fonctionnality to sensor speed.
This commit is contained in:
parent
fe8f3602ff
commit
a8d587bc53
@ -12,6 +12,7 @@ from homeassistant.components.sensor import (
|
|||||||
SensorDeviceClass,
|
SensorDeviceClass,
|
||||||
SensorEntity,
|
SensorEntity,
|
||||||
SensorEntityDescription,
|
SensorEntityDescription,
|
||||||
|
SensorStateClass,
|
||||||
)
|
)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_NAME,
|
CONF_NAME,
|
||||||
@ -45,12 +46,14 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
|||||||
name="Down Speed",
|
name="Down Speed",
|
||||||
device_class=SensorDeviceClass.DATA_RATE,
|
device_class=SensorDeviceClass.DATA_RATE,
|
||||||
native_unit_of_measurement=UnitOfDataRate.KIBIBYTES_PER_SECOND,
|
native_unit_of_measurement=UnitOfDataRate.KIBIBYTES_PER_SECOND,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=SENSOR_TYPE_UPLOAD_SPEED,
|
key=SENSOR_TYPE_UPLOAD_SPEED,
|
||||||
name="Up Speed",
|
name="Up Speed",
|
||||||
device_class=SensorDeviceClass.DATA_RATE,
|
device_class=SensorDeviceClass.DATA_RATE,
|
||||||
native_unit_of_measurement=UnitOfDataRate.KIBIBYTES_PER_SECOND,
|
native_unit_of_measurement=UnitOfDataRate.KIBIBYTES_PER_SECOND,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user