Remove '- type:' from configuration

This commit is contained in:
Fabian Affolter 2015-09-08 13:05:58 +02:00
parent 985f20d281
commit da508236e6

View file

@ -1,8 +1,7 @@
""" """
homeassistant.components.sensor.transmission homeassistant.components.sensor.transmission
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Monitors Transmission BitTorrent client API.
Monitors Transmission BitTorrent client API
Configuration: Configuration:
@ -17,9 +16,9 @@ sensor:
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)