Skip to content

Commit

Permalink
Add state class to qBittorrent UL / DL speed (#127988)
Browse files Browse the repository at this point in the history
  • Loading branch information
owenvoke authored Oct 9, 2024
1 parent c3cbdd0 commit 983607e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions homeassistant/components/qbittorrent/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
SensorDeviceClass,
SensorEntity,
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import STATE_IDLE, UnitOfDataRate
Expand Down Expand Up @@ -79,6 +80,7 @@ class QBittorrentSensorEntityDescription(SensorEntityDescription):
QBittorrentSensorEntityDescription(
key=SENSOR_TYPE_DOWNLOAD_SPEED,
translation_key="download_speed",
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.DATA_RATE,
native_unit_of_measurement=UnitOfDataRate.BYTES_PER_SECOND,
suggested_display_precision=2,
Expand All @@ -88,6 +90,7 @@ class QBittorrentSensorEntityDescription(SensorEntityDescription):
QBittorrentSensorEntityDescription(
key=SENSOR_TYPE_UPLOAD_SPEED,
translation_key="upload_speed",
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.DATA_RATE,
native_unit_of_measurement=UnitOfDataRate.BYTES_PER_SECOND,
suggested_display_precision=2,
Expand Down

0 comments on commit 983607e

Please sign in to comment.