Add and use bunch of data size and rate related constants (#31781)

Also fix a few units to match the corresponding data.
This commit is contained in:
Ville Skyttä
2020-02-13 18:52:58 +02:00
committed by GitHub
parent 0173c61fee
commit 3e23a3a860
41 changed files with 349 additions and 223 deletions

View File

@ -1,13 +1,16 @@
"""Constants for the Transmission Bittorent Client component."""
from homeassistant.const import DATA_RATE_MEGABYTES_PER_SECOND
DOMAIN = "transmission"
SENSOR_TYPES = {
"active_torrents": ["Active Torrents", "Torrents"],
"current_status": ["Status", None],
"download_speed": ["Down Speed", "MB/s"],
"download_speed": ["Down Speed", DATA_RATE_MEGABYTES_PER_SECOND],
"paused_torrents": ["Paused Torrents", "Torrents"],
"total_torrents": ["Total Torrents", "Torrents"],
"upload_speed": ["Up Speed", "MB/s"],
"upload_speed": ["Up Speed", DATA_RATE_MEGABYTES_PER_SECOND],
"completed_torrents": ["Completed Torrents", "Torrents"],
"started_torrents": ["Started Torrents", "Torrents"],
}