From ecb4316e819326f39a3dd92dc5ceb8734797996d Mon Sep 17 00:00:00 2001 From: Joe Neuman Date: Mon, 22 Apr 2024 00:30:38 -0700 Subject: [PATCH] Update qBittorrent documentation - add get_torrents and get_all_torrents services (#32384) Co-authored-by: Franck Nijhof --- source/_integrations/qbittorrent.markdown | 43 +++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/source/_integrations/qbittorrent.markdown b/source/_integrations/qbittorrent.markdown index c2fab00dff9..90ea7c3670b 100644 --- a/source/_integrations/qbittorrent.markdown +++ b/source/_integrations/qbittorrent.markdown @@ -8,8 +8,8 @@ ha_config_flow: true ha_iot_class: Local Polling ha_domain: qbittorrent ha_codeowners: - - '@geoffreylagaisse' - - '@finder39' + - "@geoffreylagaisse" + - "@finder39" ha_platforms: - sensor ha_integration_type: service @@ -34,3 +34,42 @@ The qBittorrent integration will add the following sensors: - `sensor.qbittorrent_active_torrents`: The current active torrents in qBittorrent. - `sensor.qbittorrent_inactive_torrents`: The current inactive torrents in qBittorrent. - `sensor.qbittorrent_paused_torrents`: The current paused torrents in qBittorrent. + +## Services + +### Service `qbittorrent.get_torrents` + +This service populates [Response Data](/docs/scripts/service-calls#use-templates-to-handle-response-data) +with a dictionary of torrents based on the provided filter. + +| Service data attribute | Optional | Description | Example | +| ---------------------- | -------- | ---------------------------------------------- | --------------------------------------------------- | +| `device` | no | The device you'd like to check the torrents of | all, active, inactive, paused, downloading, seeding | +| `torrent_filter` | no | The type of torrents you want in the response | all, active, inactive, paused, downloading, seeding | + +```yaml +service: qbittorrent.get_torrents +data: + filter: "all" +response_variable: torrents +``` + +The response data contains the field `torrents` which contains a dictionary of torrents. The names of the torrents are the keys. + +### Service `qbittorrent.get_all_torrents` + +This service populates [Response Data](/docs/scripts/service-calls#use-templates-to-handle-response-data) +with a dictionary of torrents based on the provided filter. + +| Service data attribute | Optional | Description | Example | +| ---------------------- | -------- | --------------------------------------------- | --------------------------------------------------- | +| `torrent_filter` | no | The type of torrents you want in the response | all, active, inactive, paused, downloading, seeding | + +```yaml +service: qbittorrent.get_all_torrents +data: + filter: "all" +response_variable: all_torrents +``` + +The response data contains the field `all_torrents`, which contains a dictionary of integrations, which each contains a dictionary of torrents. The names of the torrents are the keys.