Improve docs for the transmission integration (#13053)

* Fix wording, add transmission.remove_torrent service description

* Add transmission_removed_torrent event
This commit is contained in:
Gleb Sinyavskiy 2020-04-20 15:08:17 +02:00 committed by GitHub
parent 1646913c1c
commit 24eaf54d63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,7 +43,7 @@ transmission:
{% configuration %} {% configuration %}
host: host:
description: "This is the IP address of your Transmission daemon, e.g., `192.168.1.1`." description: "This is the IP address of your Transmission daemon, e.g., `192.168.1.1` or `https://example.com/transmission/rpc`."
required: true required: true
type: string type: string
port: port:
@ -96,6 +96,7 @@ Possible events are:
- transmission_downloaded_torrent - transmission_downloaded_torrent
- transmission_started_torrent - transmission_started_torrent
- transmission_removed_torrent
Inside of the event, there is the name of the torrent that is started or completed, as it is seen in the Transmission User Interface. Inside of the event, there is the name of the torrent that is started or completed, as it is seen in the Transmission User Interface.
@ -123,20 +124,30 @@ Adds a new torrent to download. It can either be a URL (HTTP, HTTPS or FTP), mag
| Service data attribute | Optional | Description | | Service data attribute | Optional | Description |
| ---------------------- | -------- | ----------- | | ---------------------- | -------- | ----------- |
| `name` | no | Name of the configured instance | `name` | yes | Name of the configured instance (Default: "Transmission")
| `torrent` | no | Torrent to download | `torrent` | no | Torrent to download
### Service `remove_torrent`
Removes a torrent from the client.
| Service data attribute | Optional | Description |
| ---------------------- | -------- | ----------- |
| `name` | no | Name of the configured instance (Default: "Transmission")
| `id` | no | ID of the torrent, can be found in the `torrent_info` attribute of the `*_torrents` sensors
| `delete_data` | yes | Delete torrent data (Default: false)
## Templating ## Templating
### Sensor `started_torrents` ### Attribute `torrent_info`
The state attribute `torrent_info` contains information about the torrents that are currently downloading. You can see this information in **Developer Tools** -> **States** -> `sensor.transmission_started_torrents` -> **Attributes**, or by adding a Markdown Card to Lovelace. All `*_torrents` sensors e.g. `sensor.transmission_total_torrents` or `sensor.transmission_started_torrents` have a state attribute `torrent_info` that contains information about the torrents that are currently in a corresponding state. You can see this information in **Developer Tools** -> **States** -> `sensor.transmission_total_torrents` -> **Attributes**, or by adding a Markdown Card to Lovelace.
{% raw %} {% raw %}
```yaml ```yaml
content: > content: >
{% set payload = state_attr('sensor.transmission_started_torrents', 'torrent_info') %} {% set payload = state_attr('sensor.transmission_total_torrents', 'torrent_info') %}
{% for torrent in payload.items() %} {% set name = torrent[0] %} {% set data = torrent[1] %} {% for torrent in payload.items() %} {% set name = torrent[0] %} {% set data = torrent[1] %}