mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 18:28:14 +02:00
Improve the transmission integration (#34223)
* Update state after adding a new torrent * Use cached torrents list in check_started_torrent_info * Add torrent_info to all sensors * Add torrent_info for active torrents * Fix typo * Update codeowners * Do not set eta if it's unknown * Fix codeowners * Extract TransmissionSpeedSensor * Extract TransmissionStatusSensor * Extract TransmissionTorrentsSensor * Refactor device_state_attributes() and update() * Remove unused methods * Use async_on_remove * Fix sensor update * Add transmission.remove_torrent service * Add transmission_removed_torrent event * Fix naming * Fix typo in services.yaml
This commit is contained in:
@ -1,27 +1,24 @@
|
||||
"""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", DATA_RATE_MEGABYTES_PER_SECOND],
|
||||
"paused_torrents": ["Paused Torrents", "Torrents"],
|
||||
"total_torrents": ["Total Torrents", "Torrents"],
|
||||
"upload_speed": ["Up Speed", DATA_RATE_MEGABYTES_PER_SECOND],
|
||||
"completed_torrents": ["Completed Torrents", "Torrents"],
|
||||
"started_torrents": ["Started Torrents", "Torrents"],
|
||||
}
|
||||
SWITCH_TYPES = {"on_off": "Switch", "turtle_mode": "Turtle Mode"}
|
||||
|
||||
DEFAULT_DELETE_DATA = False
|
||||
DEFAULT_NAME = "Transmission"
|
||||
DEFAULT_PORT = 9091
|
||||
DEFAULT_SCAN_INTERVAL = 120
|
||||
|
||||
STATE_ATTR_TORRENT_INFO = "torrent_info"
|
||||
|
||||
ATTR_DELETE_DATA = "delete_data"
|
||||
ATTR_TORRENT = "torrent"
|
||||
|
||||
SERVICE_ADD_TORRENT = "add_torrent"
|
||||
SERVICE_REMOVE_TORRENT = "remove_torrent"
|
||||
|
||||
DATA_UPDATED = "transmission_data_updated"
|
||||
|
||||
EVENT_STARTED_TORRENT = "transmission_started_torrent"
|
||||
EVENT_REMOVED_TORRENT = "transmission_removed_torrent"
|
||||
EVENT_DOWNLOADED_TORRENT = "transmission_downloaded_torrent"
|
||||
|
Reference in New Issue
Block a user