From fdb46d80baad74d5e86716c4660f685193571b7f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 13 May 2015 19:18:30 +0200 Subject: [PATCH] Update documentation --- config/custom_components/example.py | 4 +- homeassistant/components/demo.py | 4 +- homeassistant/components/discovery.py | 4 +- homeassistant/components/group.py | 4 +- homeassistant/components/http.py | 2 +- homeassistant/components/isy994.py | 15 ++++--- homeassistant/components/keyboard.py | 2 +- homeassistant/components/logbook.py | 4 +- homeassistant/components/modbus.py | 15 ++++--- homeassistant/components/notify/pushbullet.py | 19 ++++++++ homeassistant/components/notify/pushover.py | 5 ++- homeassistant/components/notify/xmpp.py | 4 +- .../components/scheduler/__init__.py | 21 +++++---- homeassistant/components/scheduler/time.py | 6 +-- homeassistant/components/sensor/isy994.py | 13 +++--- homeassistant/components/sensor/mysensors.py | 22 +++++++--- homeassistant/components/sensor/sabnzbd.py | 14 +++--- .../components/sensor/systemmonitor.py | 43 +++++++++++++++++-- .../components/sensor/transmission.py | 22 ++++------ homeassistant/components/sensor/vera.py | 10 +++-- homeassistant/components/simple_alarm.py | 2 +- homeassistant/components/switch/isy994.py | 19 ++++---- homeassistant/components/switch/modbus.py | 5 ++- homeassistant/components/switch/tellstick.py | 11 +++-- homeassistant/components/switch/wemo.py | 13 ++++-- homeassistant/components/switch/wink.py | 7 ++- homeassistant/components/wink.py | 7 ++- 27 files changed, 197 insertions(+), 100 deletions(-) diff --git a/config/custom_components/example.py b/config/custom_components/example.py index a972e3ab576..dc18aae4b98 100644 --- a/config/custom_components/example.py +++ b/config/custom_components/example.py @@ -22,7 +22,7 @@ DOMAIN = "example" # List of component names (string) your component depends upon # We depend on group because group will be loaded after all the components that -# initalize devices have been setup. +# initialize devices have been setup. DEPENDENCIES = ['group'] # Configuration key for the entity id we are targetting @@ -115,5 +115,5 @@ def setup(hass, config): # Register our service with HASS. hass.services.register(DOMAIN, SERVICE_FLASH, flash_service) - # Tells the bootstrapper that the component was succesfully initialized + # Tells the bootstrapper that the component was successfully initialized return True diff --git a/homeassistant/components/demo.py b/homeassistant/components/demo.py index 9d8d027522b..2abae8095d6 100644 --- a/homeassistant/components/demo.py +++ b/homeassistant/components/demo.py @@ -1,8 +1,8 @@ """ homeassistant.components.demo -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Sets up a demo environment that mimics interaction with devices +Sets up a demo environment that mimics interaction with devices. """ import time diff --git a/homeassistant/components/discovery.py b/homeassistant/components/discovery.py index 2a9cb64f6ec..819d45b5b68 100644 --- a/homeassistant/components/discovery.py +++ b/homeassistant/components/discovery.py @@ -1,11 +1,13 @@ """ +homeassistant.components.discovery +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Starts a service to scan in intervals for new devices. Will emit EVENT_PLATFORM_DISCOVERED whenever a new service has been discovered. Knows which components handle certain types, will make sure they are loaded before the EVENT_PLATFORM_DISCOVERED is fired. - """ import logging import threading diff --git a/homeassistant/components/group.py b/homeassistant/components/group.py index 7dc1cb54282..20931f2b363 100644 --- a/homeassistant/components/group.py +++ b/homeassistant/components/group.py @@ -1,6 +1,6 @@ """ -homeassistant.components.groups -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +homeassistant.components.group +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Provides functionality to group devices that can be turned on or off. """ diff --git a/homeassistant/components/http.py b/homeassistant/components/http.py index fed43cb43de..e9ffea0d592 100644 --- a/homeassistant/components/http.py +++ b/homeassistant/components/http.py @@ -1,6 +1,6 @@ """ homeassistant.components.httpinterface -~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module provides an API and a HTTP interface for debug purposes. diff --git a/homeassistant/components/isy994.py b/homeassistant/components/isy994.py index 111f47e6f5d..2ff9b5caeaf 100644 --- a/homeassistant/components/isy994.py +++ b/homeassistant/components/isy994.py @@ -1,4 +1,7 @@ """ +homeassistant.components.isy994 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Connects to an ISY-994 controller and loads relevant components to control its devices. Also contains the base classes for ISY Sensors, Lights, and Switches. """ @@ -32,7 +35,7 @@ _LOGGER = logging.getLogger(__name__) def setup(hass, config): """ - Setup isy994 component. + Setup ISY994 component. This will automatically import associated lights, switches, and sensors. """ try: @@ -101,7 +104,7 @@ def stop(event): class ISYDeviceABC(ToggleEntity): - """ Abstract Class for an ISY device within home assistant. """ + """ Abstract Class for an ISY device. """ _attrs = {} _onattrs = [] @@ -142,7 +145,7 @@ class ISYDeviceABC(ToggleEntity): @property def value(self): - """ returns the unclean value from the controller """ + """ Returns the unclean value from the controller. """ # pylint: disable=protected-access return self.node.status._val @@ -156,7 +159,7 @@ class ISYDeviceABC(ToggleEntity): @property def unique_id(self): - """ Returns the id of this isy sensor """ + """ Returns the id of this ISY sensor. """ # pylint: disable=protected-access return self.node._id @@ -199,7 +202,7 @@ class ISYDeviceABC(ToggleEntity): return self.value def turn_on(self, **kwargs): - """ turns the device on """ + """ Turns the device on. """ if self.domain is not 'sensor': attrs = [kwargs.get(name) for name in self._onattrs] self.node.on(*attrs) @@ -207,7 +210,7 @@ class ISYDeviceABC(ToggleEntity): _LOGGER.error('ISY cannot turn on sensors.') def turn_off(self, **kwargs): - """ turns the device off """ + """ Turns the device off. """ if self.domain is not 'sensor': self.node.off() else: diff --git a/homeassistant/components/keyboard.py b/homeassistant/components/keyboard.py index 8e820856c34..b4959b48055 100644 --- a/homeassistant/components/keyboard.py +++ b/homeassistant/components/keyboard.py @@ -1,5 +1,5 @@ """ -homeassistant.keyboard +homeassistant.components.keyboard ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Provides functionality to emulate keyboard presses on host machine. diff --git a/homeassistant/components/logbook.py b/homeassistant/components/logbook.py index 68718a7ac43..cad31d41cab 100644 --- a/homeassistant/components/logbook.py +++ b/homeassistant/components/logbook.py @@ -1,8 +1,8 @@ """ homeassistant.components.logbook -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Parses events and generates a human log +Parses events and generates a human log. """ from itertools import groupby diff --git a/homeassistant/components/modbus.py b/homeassistant/components/modbus.py index 97b0ec7405a..90a0929e6c0 100644 --- a/homeassistant/components/modbus.py +++ b/homeassistant/components/modbus.py @@ -1,9 +1,12 @@ """ -components.modbus -~~~~~~~~~~~~~~~~~~~~~~~~~ +homeassistant.components.modbus +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Modbus component, using pymodbus (python3 branch) -typical declaration in configuration.yaml +Configuration: + +To use the Modbus component you will need to add something like the following +to your config/configuration.yaml #Modbus TCP modbus: @@ -27,10 +30,8 @@ import logging from homeassistant.const import (EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP) -# The domain of your component. Should be equal to the name of your component DOMAIN = "modbus" -# List of component names (string) your component depends upon DEPENDENCIES = [] # Type of network @@ -86,11 +87,11 @@ def setup(hass, config): return False def stop_modbus(event): - """ Stop Modbus service""" + """ Stop Modbus service. """ NETWORK.close() def start_modbus(event): - """ Start Modbus service""" + """ Start Modbus service. """ NETWORK.connect() hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, stop_modbus) diff --git a/homeassistant/components/notify/pushbullet.py b/homeassistant/components/notify/pushbullet.py index cea1b216e8b..09bfd3244c8 100644 --- a/homeassistant/components/notify/pushbullet.py +++ b/homeassistant/components/notify/pushbullet.py @@ -1,5 +1,24 @@ """ +homeassistant.components.notify.pushbullet +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + PushBullet platform for notify component. + +Configuration: + +To use the PushBullet notifier you will need to add something like the +following to your config/configuration.yaml + +notify: + platform: pushbullet + api_key: YOUR_API_KEY + +Variables: + +api_key +*Required +Enter the API key for PushBullet. Go to https://www.pushbullet.com/ to retrieve +your API key. """ import logging diff --git a/homeassistant/components/notify/pushover.py b/homeassistant/components/notify/pushover.py index 466cfce8ea0..f8ec652a39c 100644 --- a/homeassistant/components/notify/pushover.py +++ b/homeassistant/components/notify/pushover.py @@ -1,4 +1,7 @@ """ +homeassistant.components.notify.pushover +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Pushover platform for notify component. Configuration: @@ -11,7 +14,7 @@ notify: api_key: ABCDEFGHJKLMNOPQRSTUVXYZ user_key: ABCDEFGHJKLMNOPQRSTUVXYZ -VARIABLES: +Variables: api_key *Required diff --git a/homeassistant/components/notify/xmpp.py b/homeassistant/components/notify/xmpp.py index e6718bdfffe..43bb5799458 100644 --- a/homeassistant/components/notify/xmpp.py +++ b/homeassistant/components/notify/xmpp.py @@ -15,7 +15,7 @@ notify: password: YOUR_JABBER_ACCOUNT_PASSWORD recipient: YOUR_RECIPIENT -VARIABLES: +Variables: sender *Required @@ -110,7 +110,7 @@ class SendNotificationBot(sleekxmpp.ClientXMPP): self.use_tls = True self.use_ipv6 = False - self.add_event_handler("failed_auth", self.check_credentials) + self.add_event_handler('failed_auth', self.check_credentials) self.add_event_handler('session_start', self.start) self.connect() self.process(block=False) diff --git a/homeassistant/components/scheduler/__init__.py b/homeassistant/components/scheduler/__init__.py index 858c068629f..e69ba6627a7 100644 --- a/homeassistant/components/scheduler/__init__.py +++ b/homeassistant/components/scheduler/__init__.py @@ -8,12 +8,12 @@ It will read a json object from schedule.json in the config dir and create a schedule based on it. Each schedule is a JSON with the keys id, name, description, entity_ids, and events. -- days is an array with the weekday number (monday=0) that the schdule +- days is an array with the weekday number (monday=0) that the schedule is active - entity_ids an array with entity ids that the events in the schedule should effect (can also be groups) - events is an array of objects that describe the different events that is - supported. Read in the events descriptions for more information + supported. Read in the events descriptions for more information. """ import logging import json @@ -22,7 +22,6 @@ from homeassistant import bootstrap from homeassistant.loader import get_component from homeassistant.const import ATTR_ENTITY_ID -# The domain of your component. Should be equal to the name of your component DOMAIN = 'scheduler' DEPENDENCIES = [] @@ -33,10 +32,10 @@ _SCHEDULE_FILE = 'schedule.json' def setup(hass, config): - """ Create the schedules """ + """ Create the schedules. """ def setup_listener(schedule, event_data): - """ Creates the event listener based on event_data """ + """ Creates the event listener based on event_data. """ event_type = event_data['type'] component = event_type @@ -52,7 +51,7 @@ def setup(hass, config): event_data) def setup_schedule(schedule_data): - """ setup a schedule based on the description """ + """ Setup a schedule based on the description. """ schedule = Schedule(schedule_data['id'], name=schedule_data['name'], @@ -97,17 +96,17 @@ class Schedule(object): self.__event_listeners = [] def add_event_listener(self, event_listener): - """ Add a event to the schedule """ + """ Add a event to the schedule. """ self.__event_listeners.append(event_listener) def schedule(self, hass): - """ Schedule all the events in the schdule """ + """ Schedule all the events in the schedule. """ for event in self.__event_listeners: event.schedule(hass) class EventListener(object): - """ The base EventListner class that the schedule uses """ + """ The base EventListener class that the schedule uses. """ def __init__(self, schedule): self.my_schedule = schedule @@ -122,7 +121,7 @@ class EventListener(object): # pylint: disable=too-few-public-methods class ServiceEventListener(EventListener): - """ A EventListner that calls a service when executed """ + """ A EventListener that calls a service when executed. """ def __init__(self, schdule, service): EventListener.__init__(self, schdule) @@ -130,7 +129,7 @@ class ServiceEventListener(EventListener): (self.domain, self.service) = service.split('.') def execute(self, hass): - """ Call the service """ + """ Call the service. """ data = {ATTR_ENTITY_ID: self.my_schedule.entity_ids} hass.call_service(self.domain, self.service, data) diff --git a/homeassistant/components/scheduler/time.py b/homeassistant/components/scheduler/time.py index 735ccc361a8..94eabe7dd2b 100644 --- a/homeassistant/components/scheduler/time.py +++ b/homeassistant/components/scheduler/time.py @@ -22,7 +22,7 @@ _LOGGER = logging.getLogger(__name__) def create_event_listener(schedule, event_listener_data): - """ Create a TimeEvent based on the description """ + """ Create a TimeEvent based on the description. """ service = event_listener_data['service'] (hour, minute, second) = [int(x) for x in @@ -33,7 +33,7 @@ def create_event_listener(schedule, event_listener_data): # pylint: disable=too-few-public-methods class TimeEventListener(ServiceEventListener): - """ The time event that the scheduler uses """ + """ The time event that the scheduler uses. """ # pylint: disable=too-many-arguments def __init__(self, schedule, service, hour, minute, second): @@ -44,7 +44,7 @@ class TimeEventListener(ServiceEventListener): self.second = second def schedule(self, hass): - """ Schedule this event so that it will be called """ + """ Schedule this event so that it will be called. """ next_time = datetime.now().replace(hour=self.hour, minute=self.minute, diff --git a/homeassistant/components/sensor/isy994.py b/homeassistant/components/sensor/isy994.py index 739a058d24d..7a242c044f7 100644 --- a/homeassistant/components/sensor/isy994.py +++ b/homeassistant/components/sensor/isy994.py @@ -1,8 +1,11 @@ -""" Support for ISY994 sensors. """ -# system imports +""" +homeassistant.components.sensor.isy994 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Support for ISY994 sensors. +""" import logging -# homeassistant imports from homeassistant.components.isy994 import (ISY, ISYDeviceABC, SENSOR_STRING, HIDDEN_STRING) from homeassistant.const import (STATE_OPEN, STATE_CLOSED, STATE_HOME, @@ -24,7 +27,7 @@ DEFAULT_HIDDEN_WEATHER = ['Temperature_High', 'Temperature_Low', 'Feels_Like', def setup_platform(hass, config, add_devices, discovery_info=None): - """ Sets up the isy994 platform. """ + """ Sets up the ISY994 platform. """ # pylint: disable=protected-access logger = logging.getLogger(__name__) devs = [] @@ -81,7 +84,7 @@ class WeatherPseudoNode(object): class ISYSensorDevice(ISYDeviceABC): - """ represents a isy sensor within home assistant. """ + """ Represents a ISY sensor. """ _domain = 'sensor' diff --git a/homeassistant/components/sensor/mysensors.py b/homeassistant/components/sensor/mysensors.py index 807ddb6b485..36b623552c4 100644 --- a/homeassistant/components/sensor/mysensors.py +++ b/homeassistant/components/sensor/mysensors.py @@ -1,13 +1,23 @@ """ homeassistant.components.sensor.mysensors -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -MySensors sensors. +Support for MySensors sensors. -Config: - sensor: - - platform: mysensors - port: '/dev/ttyACM0' +Configuration: + +To use the MySensors sensor you will need to add something like the +following to your config/configuration.yaml + +sensor: + platform: mysensors + port: '/dev/ttyACM0' + +Variables: + +port +*Required +Port of your connection to your MySensors device. """ import logging diff --git a/homeassistant/components/sensor/sabnzbd.py b/homeassistant/components/sensor/sabnzbd.py index a1230def614..cc37bd96b6f 100644 --- a/homeassistant/components/sensor/sabnzbd.py +++ b/homeassistant/components/sensor/sabnzbd.py @@ -1,6 +1,6 @@ """ homeassistant.components.sensor.sabnzbd -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Monitors SABnzbd NZB client API @@ -22,14 +22,12 @@ sensor: - type: 'disk_size' - type: 'disk_free' -VARIABLES: +Variables: base_url *Required This is the base URL of your SABnzbd instance including the port number if not -running on 80 -Example: http://192.168.1.32:8124/ - +running on 80. Example: http://192.168.1.32:8124/ name *Optional @@ -44,9 +42,7 @@ 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 - - +list of all available variables. """ from homeassistant.util import Throttle @@ -75,7 +71,7 @@ _THROTTLED_REFRESH = None # pylint: disable=unused-argument def setup_platform(hass, config, add_devices, discovery_info=None): - """ Sets up the sensors """ + """ Sets up the sensors. """ api_key = config.get("api_key") base_url = config.get("base_url") name = config.get("name", "SABnzbd") diff --git a/homeassistant/components/sensor/systemmonitor.py b/homeassistant/components/sensor/systemmonitor.py index e03e987802b..0f9d570f92a 100644 --- a/homeassistant/components/sensor/systemmonitor.py +++ b/homeassistant/components/sensor/systemmonitor.py @@ -1,9 +1,46 @@ """ homeassistant.components.sensor.systemmonitor -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Shows system monitor values such as: disk, memory and processor use +Configuration: + +To use the System monitor sensor you will need to add something like the +following to your config/configuration.yaml + +sensor: + platform: systemmonitor + resources: + - type: 'disk_use_percent' + arg: '/' + - type: 'disk_use' + arg: '/home' + - type: 'disk_free' + arg: '/' + - type: 'memory_use_percent' + - type: 'memory_use' + - type: 'memory_free' + - type: 'processor_use' + - type: 'process' + arg: 'octave-cli' + +Variables: + +resources +*Required +An array specifying the variables to monitor. + +These are the variables for the resources array: + +type +*Required +The variable you wish to monitor, see the configuration example above for a +sample list of variables. + +arg +*Optional +Additional details for the type, eg. path, binary name, etc. """ from homeassistant.helpers.entity import Entity @@ -28,7 +65,7 @@ _LOGGER = logging.getLogger(__name__) # pylint: disable=unused-argument def setup_platform(hass, config, add_devices, discovery_info=None): - """ Sets up the sensors """ + """ Sets up the sensors. """ dev = [] for resource in config['resources']: @@ -43,7 +80,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): class SystemMonitorSensor(Entity): - """ A system monitor sensor """ + """ A system monitor sensor. """ def __init__(self, sensor_type, argument=''): self._name = SENSOR_TYPES[sensor_type][0] + ' ' + argument diff --git a/homeassistant/components/sensor/transmission.py b/homeassistant/components/sensor/transmission.py index 7b1a66315d1..8ce2b6951ca 100644 --- a/homeassistant/components/sensor/transmission.py +++ b/homeassistant/components/sensor/transmission.py @@ -1,6 +1,6 @@ """ homeassistant.components.sensor.transmission -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Monitors Transmission BitTorrent client API @@ -21,17 +21,15 @@ sensor: - type: 'download_speed' - type: 'upload_speed' -VARIABLES: +Variables: host *Required -This is the IP address of your Transmission Daemon -Example: 192.168.1.32 +This is the IP address of your Transmission daemon. Example: 192.168.1.32 port *Optional -The port your Transmission daemon uses, defaults to 9091 -Example: 8080 +The port your Transmission daemon uses, defaults to 9091. Example: 8080 username *Required @@ -43,7 +41,7 @@ Your Transmission password name *Optional -The name to use when displaying this Transmission instance +The name to use when displaying this Transmission instance. monitored_variables *Required @@ -54,9 +52,7 @@ 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 - - +list of all available variables. """ from homeassistant.util import Throttle @@ -84,7 +80,7 @@ _THROTTLED_REFRESH = None # pylint: disable=unused-argument def setup_platform(hass, config, add_devices, discovery_info=None): - """ Sets up the sensors """ + """ Sets up the sensors. """ host = config.get(CONF_HOST) username = config.get(CONF_USERNAME, None) password = config.get(CONF_PASSWORD, None) @@ -123,7 +119,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): class TransmissionSensor(Entity): - """ A Transmission sensor """ + """ A Transmission sensor. """ def __init__(self, sensor_type, transmission_client, client_name): self._name = SENSOR_TYPES[sensor_type][0] @@ -158,7 +154,7 @@ class TransmissionSensor(Entity): ) def update(self): - """ Gets the latest from Transmission and updates the state. """ + """ Gets the latest data from Transmission and updates the state. """ self.refresh_transmission_data() if self.type == 'current_status': if self.transmission_client.session: diff --git a/homeassistant/components/sensor/vera.py b/homeassistant/components/sensor/vera.py index 4f6126e6991..1cbef3a899a 100644 --- a/homeassistant/components/sensor/vera.py +++ b/homeassistant/components/sensor/vera.py @@ -1,7 +1,11 @@ """ +homeassistant.components.sensor.vera +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Support for Vera sensors. Configuration: + To use the Vera sensors you will need to add something like the following to your config/configuration.yaml @@ -15,7 +19,7 @@ sensor: 13: name: Another sensor -VARIABLES: +Variables: vera_controller_url *Required @@ -96,12 +100,12 @@ def get_devices(hass, config): def setup_platform(hass, config, add_devices, discovery_info=None): - """ Performs setup for Vera controller devices """ + """ Performs setup for Vera controller devices. """ add_devices(get_devices(hass, config)) class VeraSensor(Entity): - """ Represents a Vera Sensor """ + """ Represents a Vera Sensor. """ def __init__(self, vera_device, extra_data=None): self.vera_device = vera_device diff --git a/homeassistant/components/simple_alarm.py b/homeassistant/components/simple_alarm.py index e4ae8e6e9e9..4f2dbd768d5 100644 --- a/homeassistant/components/simple_alarm.py +++ b/homeassistant/components/simple_alarm.py @@ -20,7 +20,7 @@ DEPENDENCIES = ['group', 'device_tracker', 'light'] CONF_KNOWN_LIGHT = "known_light" # Attribute to tell which light has to flash whem an unknown person comes home -# If ommitted will flash all. +# If omitted will flash all. CONF_UNKNOWN_LIGHT = "unknown_light" # Services to test the alarms diff --git a/homeassistant/components/switch/isy994.py b/homeassistant/components/switch/isy994.py index fe98bce69f9..75032d2954d 100644 --- a/homeassistant/components/switch/isy994.py +++ b/homeassistant/components/switch/isy994.py @@ -1,8 +1,11 @@ -""" Support for ISY994 switch. """ -# system imports +""" +homeassistant.components.switch.isy994 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Support for ISY994 switches. +""" import logging -# homeassistant imports from homeassistant.components.isy994 import (ISY, ISYDeviceABC, SENSOR_STRING, HIDDEN_STRING) from homeassistant.const import STATE_ON, STATE_OFF # STATE_OPEN, STATE_CLOSED @@ -12,7 +15,7 @@ from homeassistant.const import STATE_ON, STATE_OFF # STATE_OPEN, STATE_CLOSED def setup_platform(hass, config, add_devices, discovery_info=None): - """ Sets up the isy994 platform. """ + """ Sets up the ISY994 platform. """ # pylint: disable=too-many-locals logger = logging.getLogger(__name__) devs = [] @@ -54,7 +57,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): class ISYSwitchDevice(ISYDeviceABC): - """ represents as isy light within home assistant. """ + """ Represents as ISY light. """ _domain = 'switch' _dtype = 'binary' @@ -62,7 +65,7 @@ class ISYSwitchDevice(ISYDeviceABC): class ISYProgramDevice(ISYSwitchDevice): - """ represents a door that can be manipulated within home assistant. """ + """ Represents a door that can be manipulated. """ _domain = 'switch' _dtype = 'binary' @@ -74,9 +77,9 @@ class ISYProgramDevice(ISYSwitchDevice): self.action_node = actions def turn_on(self, **kwargs): - """ turns the device on/closes the device """ + """ Turns the device on/closes the device. """ self.action_node.runThen() def turn_off(self, **kwargs): - """ turns the device off/opens the device """ + """ Turns the device off/opens the device. """ self.action_node.runElse() diff --git a/homeassistant/components/switch/modbus.py b/homeassistant/components/switch/modbus.py index 7e5e039337f..6513ba71f4a 100644 --- a/homeassistant/components/switch/modbus.py +++ b/homeassistant/components/switch/modbus.py @@ -1,4 +1,7 @@ """ +homeassistant.components.switch.modbus +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Support for Modbus switches. Configuration: @@ -53,7 +56,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): class ModbusSwitch(ToggleEntity): - """ Represents a Modbus Switch """ + """ Represents a Modbus switch. """ def __init__(self, name, slave, register, bit): self._name = name diff --git a/homeassistant/components/switch/tellstick.py b/homeassistant/components/switch/tellstick.py index fccd2ba5c08..84f5d2b31d5 100644 --- a/homeassistant/components/switch/tellstick.py +++ b/homeassistant/components/switch/tellstick.py @@ -1,4 +1,9 @@ -""" Support for Tellstick switches. """ +""" +homeassistant.components.switch.tellstick +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Support for Tellstick switches. +""" import logging @@ -9,7 +14,7 @@ import tellcore.constants as tellcore_constants # pylint: disable=unused-argument def setup_platform(hass, config, add_devices_callback, discovery_info=None): - """ Find and return tellstick switches. """ + """ Find and return Tellstick switches. """ try: import tellcore.telldus as telldus except ImportError: @@ -30,7 +35,7 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None): class TellstickSwitchDevice(ToggleEntity): - """ represents a Tellstick switch within home assistant. """ + """ Represents a Tellstick switch within Home Assistant. """ last_sent_command_mask = (tellcore_constants.TELLSTICK_TURNON | tellcore_constants.TELLSTICK_TURNOFF) diff --git a/homeassistant/components/switch/wemo.py b/homeassistant/components/switch/wemo.py index 2baf10f53d8..d8be9286413 100644 --- a/homeassistant/components/switch/wemo.py +++ b/homeassistant/components/switch/wemo.py @@ -1,4 +1,9 @@ -""" Support for WeMo switchces. """ +""" +homeassistant.components.switch.wemo +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Support for WeMo switches. +""" import logging from homeassistant.helpers.entity import ToggleEntity @@ -8,7 +13,7 @@ from homeassistant.components.switch import ( # pylint: disable=unused-argument def setup_platform(hass, config, add_devices_callback, discovery_info=None): - """ Find and return wemo switches. """ + """ Find and return WeMo switches. """ try: # pylint: disable=no-name-in-module, import-error import homeassistant.external.pywemo.pywemo as pywemo @@ -39,7 +44,7 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None): class WemoSwitch(ToggleEntity): - """ represents a WeMo switch within home assistant. """ + """ Represents a WeMo switch within Home Assistant. """ def __init__(self, wemo): self.wemo = wemo @@ -78,5 +83,5 @@ class WemoSwitch(ToggleEntity): self.wemo.off() def update(self): - """ Update Wemo state. """ + """ Update WeMo state. """ self.wemo.get_state(True) diff --git a/homeassistant/components/switch/wink.py b/homeassistant/components/switch/wink.py index f3d38d87c29..add56d222b1 100644 --- a/homeassistant/components/switch/wink.py +++ b/homeassistant/components/switch/wink.py @@ -1,4 +1,9 @@ -""" Support for WeMo switchces. """ +""" +homeassistant.components.switch.wink +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Support for Wink switches. +""" import logging # pylint: disable=no-name-in-module, import-error diff --git a/homeassistant/components/wink.py b/homeassistant/components/wink.py index cfdbf9b1a92..5a99633041d 100644 --- a/homeassistant/components/wink.py +++ b/homeassistant/components/wink.py @@ -1,4 +1,7 @@ """ +homeassistant.components.wink +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Connects to a Wink hub and loads relevant components to control its devices. """ import logging @@ -53,14 +56,14 @@ def setup(hass, config): class WinkToggleDevice(ToggleEntity): - """ represents a Wink switch within home assistant. """ + """ Represents a Wink switch within Home Assistant. """ def __init__(self, wink): self.wink = wink @property def unique_id(self): - """ Returns the id of this WeMo switch """ + """ Returns the id of this Wink switch. """ return "{}.{}".format(self.__class__, self.wink.deviceId()) @property