Merge pull request #337 from fabaff/transmission
Update transmission configuration
This commit is contained in:
commit
8a3d9e6b8d
1 changed files with 18 additions and 25 deletions
|
@ -1,8 +1,7 @@
|
||||||
"""
|
"""
|
||||||
homeassistant.components.sensor.transmission
|
homeassistant.components.sensor.transmission
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
Monitors Transmission BitTorrent client API.
|
||||||
Monitors Transmission BitTorrent client API
|
|
||||||
|
|
||||||
Configuration:
|
Configuration:
|
||||||
|
|
||||||
|
@ -10,16 +9,16 @@ To use the Transmission sensor you will need to add something like the
|
||||||
following to your configuration.yaml file.
|
following to your configuration.yaml file.
|
||||||
|
|
||||||
sensor:
|
sensor:
|
||||||
platform: transmission
|
platform: transmission
|
||||||
name: Transmission
|
name: Transmission
|
||||||
host: 192.168.1.26
|
host: 192.168.1.26
|
||||||
port: 9091
|
port: 9091
|
||||||
username: YOUR_USERNAME
|
username: YOUR_USERNAME
|
||||||
password: YOUR_PASSWORD
|
password: YOUR_PASSWORD
|
||||||
monitored_variables:
|
monitored_variables:
|
||||||
- type: 'current_status'
|
- 'current_status'
|
||||||
- type: 'download_speed'
|
- 'download_speed'
|
||||||
- type: 'upload_speed'
|
- 'upload_speed'
|
||||||
|
|
||||||
Variables:
|
Variables:
|
||||||
|
|
||||||
|
@ -33,11 +32,11 @@ The port your Transmission daemon uses, defaults to 9091. Example: 8080
|
||||||
|
|
||||||
username
|
username
|
||||||
*Required
|
*Required
|
||||||
Your Transmission username
|
Your Transmission username.
|
||||||
|
|
||||||
password
|
password
|
||||||
*Required
|
*Required
|
||||||
Your Transmission password
|
Your Transmission password.
|
||||||
|
|
||||||
name
|
name
|
||||||
*Optional
|
*Optional
|
||||||
|
@ -45,14 +44,8 @@ The name to use when displaying this Transmission instance.
|
||||||
|
|
||||||
monitored_variables
|
monitored_variables
|
||||||
*Required
|
*Required
|
||||||
An array specifying the variables to monitor.
|
Variables to monitor. See the configuration example above for a
|
||||||
|
list of all available variables to monitor.
|
||||||
These are the variables for the monitored_variables array:
|
|
||||||
|
|
||||||
type
|
|
||||||
*Required
|
|
||||||
The variable you wish to monitor, see the configuration example above for a
|
|
||||||
list of all available variables.
|
|
||||||
"""
|
"""
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
@ -109,11 +102,11 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
|
|
||||||
dev = []
|
dev = []
|
||||||
for variable in config['monitored_variables']:
|
for variable in config['monitored_variables']:
|
||||||
if variable['type'] not in SENSOR_TYPES:
|
if variable not in SENSOR_TYPES:
|
||||||
_LOGGER.error('Sensor type: "%s" does not exist', variable['type'])
|
_LOGGER.error('Sensor type: "%s" does not exist', variable)
|
||||||
else:
|
else:
|
||||||
dev.append(TransmissionSensor(
|
dev.append(TransmissionSensor(
|
||||||
variable['type'], transmission_api, name))
|
variable, transmission_api, name))
|
||||||
|
|
||||||
add_devices(dev)
|
add_devices(dev)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue