mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Add translated native unit of measurement - QBitTorrent (#131918)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
This commit is contained in:
parent
3dc0ca7e1e
commit
b5e7da4262
@ -100,13 +100,11 @@ SENSOR_TYPES: tuple[QBittorrentSensorEntityDescription, ...] = (
|
||||
QBittorrentSensorEntityDescription(
|
||||
key=SENSOR_TYPE_ALL_TORRENTS,
|
||||
translation_key="all_torrents",
|
||||
native_unit_of_measurement="torrents",
|
||||
value_fn=lambda coordinator: count_torrents_in_states(coordinator, []),
|
||||
),
|
||||
QBittorrentSensorEntityDescription(
|
||||
key=SENSOR_TYPE_ACTIVE_TORRENTS,
|
||||
translation_key="active_torrents",
|
||||
native_unit_of_measurement="torrents",
|
||||
value_fn=lambda coordinator: count_torrents_in_states(
|
||||
coordinator, ["downloading", "uploading"]
|
||||
),
|
||||
@ -114,7 +112,6 @@ SENSOR_TYPES: tuple[QBittorrentSensorEntityDescription, ...] = (
|
||||
QBittorrentSensorEntityDescription(
|
||||
key=SENSOR_TYPE_INACTIVE_TORRENTS,
|
||||
translation_key="inactive_torrents",
|
||||
native_unit_of_measurement="torrents",
|
||||
value_fn=lambda coordinator: count_torrents_in_states(
|
||||
coordinator, ["stalledDL", "stalledUP"]
|
||||
),
|
||||
@ -122,7 +119,6 @@ SENSOR_TYPES: tuple[QBittorrentSensorEntityDescription, ...] = (
|
||||
QBittorrentSensorEntityDescription(
|
||||
key=SENSOR_TYPE_PAUSED_TORRENTS,
|
||||
translation_key="paused_torrents",
|
||||
native_unit_of_measurement="torrents",
|
||||
value_fn=lambda coordinator: count_torrents_in_states(
|
||||
coordinator, ["pausedDL", "pausedUP"]
|
||||
),
|
||||
|
@ -36,16 +36,20 @@
|
||||
}
|
||||
},
|
||||
"active_torrents": {
|
||||
"name": "Active torrents"
|
||||
"name": "Active torrents",
|
||||
"unit_of_measurement": "torrents"
|
||||
},
|
||||
"inactive_torrents": {
|
||||
"name": "Inactive torrents"
|
||||
"name": "Inactive torrents",
|
||||
"unit_of_measurement": "[%key:component::qbittorrent::entity::sensor::active_torrents::unit_of_measurement%]"
|
||||
},
|
||||
"paused_torrents": {
|
||||
"name": "Paused torrents"
|
||||
"name": "Paused torrents",
|
||||
"unit_of_measurement": "[%key:component::qbittorrent::entity::sensor::active_torrents::unit_of_measurement%]"
|
||||
},
|
||||
"all_torrents": {
|
||||
"name": "All torrents"
|
||||
"name": "All torrents",
|
||||
"unit_of_measurement": "[%key:component::qbittorrent::entity::sensor::active_torrents::unit_of_measurement%]"
|
||||
}
|
||||
},
|
||||
"switch": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user