Update docstring (quotes, links, content) (#5602)

This commit is contained in:
Fabian Affolter 2017-01-28 16:02:19 +01:00 committed by GitHub
parent 72bc8fc5bf
commit e1412a223c
9 changed files with 32 additions and 33 deletions

View File

@ -14,11 +14,10 @@ import voluptuous as vol
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from homeassistant.components.device_tracker import DOMAIN, PLATFORM_SCHEMA from homeassistant.components.device_tracker import DOMAIN, PLATFORM_SCHEMA
from homeassistant.const import (CONF_HOST, CONF_PASSWORD, CONF_USERNAME, from homeassistant.const import (
CONF_VERIFY_SSL) CONF_HOST, CONF_PASSWORD, CONF_USERNAME, CONF_VERIFY_SSL)
from homeassistant.util import Throttle from homeassistant.util import Throttle
# Return cached results if last scan was less then this time ago.
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5) MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
INTERFACES = 2 INTERFACES = 2
DEFAULT_TIMEOUT = 10 DEFAULT_TIMEOUT = 10
@ -59,7 +58,7 @@ class LinksysAPDeviceScanner(object):
# Check if the access point is accessible # Check if the access point is accessible
response = self._make_request() response = self._make_request()
if not response.status_code == 200: if not response.status_code == 200:
raise ConnectionError('Cannot connect to Linksys Access Point') raise ConnectionError("Cannot connect to Linksys Access Point")
def scan_devices(self): def scan_devices(self):
"""Scan for new devices and return a list with found device IDs.""" """Scan for new devices and return a list with found device IDs."""
@ -83,7 +82,7 @@ class LinksysAPDeviceScanner(object):
from bs4 import BeautifulSoup as BS from bs4 import BeautifulSoup as BS
with self.lock: with self.lock:
_LOGGER.info('Checking Linksys AP') _LOGGER.info("Checking Linksys AP")
self.last_results = [] self.last_results = []
for interface in range(INTERFACES): for interface in range(INTERFACES):

View File

@ -1,10 +1,8 @@
""" """
Support for Sky Hub. Support for Sky Hub.
# Example configuration.yaml entry For more details about this platform, please refer to the documentation at
device_tracker: https://home-assistant.io/components/device_tracker.sky_hub/
- platform: sky_hub
host: 192.168.1.254
""" """
import logging import logging
import re import re
@ -20,13 +18,11 @@ from homeassistant.components.device_tracker import (
from homeassistant.const import CONF_HOST from homeassistant.const import CONF_HOST
from homeassistant.util import Throttle from homeassistant.util import Throttle
# Return cached results if last scan was less then this time ago.
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
_MAC_REGEX = re.compile(r'(([0-9A-Fa-f]{1,2}\:){5}[0-9A-Fa-f]{1,2})') _MAC_REGEX = re.compile(r'(([0-9A-Fa-f]{1,2}\:){5}[0-9A-Fa-f]{1,2})')
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_HOST): cv.string vol.Required(CONF_HOST): cv.string
}) })
@ -45,7 +41,7 @@ class SkyHubDeviceScanner(DeviceScanner):
def __init__(self, config): def __init__(self, config):
"""Initialise the scanner.""" """Initialise the scanner."""
_LOGGER.info('Initialising Sky Hub') _LOGGER.info("Initialising Sky Hub")
self.host = config.get(CONF_HOST, '192.168.1.254') self.host = config.get(CONF_HOST, '192.168.1.254')
self.lock = threading.Lock() self.lock = threading.Lock()
@ -86,7 +82,7 @@ class SkyHubDeviceScanner(DeviceScanner):
return False return False
with self.lock: with self.lock:
_LOGGER.info('Scanning') _LOGGER.info("Scanning")
data = _get_skyhub_data(self.url) data = _get_skyhub_data(self.url)

View File

@ -1,8 +1,8 @@
""" """
Support for Tado Smart Thermostat. Support for Tado Smart Thermostat.
Device tracker platform that supports presence detection. For more details about this platform, please refer to the documentation at
The detection is based on geofencing enabled devices used with Tado. https://home-assistant.io/components/device_tracker.tado/
""" """
import logging import logging
from datetime import timedelta from datetime import timedelta
@ -17,15 +17,14 @@ import voluptuous as vol
from homeassistant.const import CONF_USERNAME, CONF_PASSWORD from homeassistant.const import CONF_USERNAME, CONF_PASSWORD
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from homeassistant.util import Throttle from homeassistant.util import Throttle
from homeassistant.components.device_tracker import \ from homeassistant.components.device_tracker import (
DOMAIN, PLATFORM_SCHEMA, DeviceScanner DOMAIN, PLATFORM_SCHEMA, DeviceScanner)
from homeassistant.helpers.aiohttp_client import async_create_clientsession from homeassistant.helpers.aiohttp_client import async_create_clientsession
# Return cached results if last scan was less then this time ago
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=30)
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=30)
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_PASSWORD): cv.string, vol.Required(CONF_PASSWORD): cv.string,
vol.Required(CONF_USERNAME): cv.string vol.Required(CONF_USERNAME): cv.string

View File

@ -55,7 +55,7 @@ class AvionLight(Light):
self._name = device['name'] self._name = device['name']
self._address = device['address'] self._address = device['address']
self._key = device["key"] self._key = device['key']
self._brightness = 255 self._brightness = 255
self._state = False self._state = False
self._switch = avion.avion(self._address, self._key) self._switch = avion.avion(self._address, self._key)

View File

@ -1,9 +1,9 @@
""" """
Component for interacting with a Lutron RadioRA 2 system. Component for interacting with a Lutron RadioRA 2 system.
Uses pylutron (http://github.com/thecynic/pylutron). For more details about this component, please refer to the documentation at
https://home-assistant.io/components/lutron/
""" """
import logging import logging
from homeassistant.helpers import discovery from homeassistant.helpers import discovery
@ -13,7 +13,7 @@ from homeassistant.loader import get_component
REQUIREMENTS = ['https://github.com/thecynic/pylutron/archive/v0.1.0.zip#' REQUIREMENTS = ['https://github.com/thecynic/pylutron/archive/v0.1.0.zip#'
'pylutron==0.1.0'] 'pylutron==0.1.0']
DOMAIN = "lutron" DOMAIN = 'lutron'
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@ -38,7 +38,7 @@ def setup(hass, base_config):
) )
hass.data[LUTRON_CONTROLLER].load_xml_db() hass.data[LUTRON_CONTROLLER].load_xml_db()
hass.data[LUTRON_CONTROLLER].connect() hass.data[LUTRON_CONTROLLER].connect()
_LOGGER.info("Connected to Main Repeater @ %s", config['lutron_host']) _LOGGER.info("Connected to Main Repeater at %s", config['lutron_host'])
group = get_component('group') group = get_component('group')

View File

@ -1,4 +1,9 @@
"""Discord platform for notify component.""" """
Discord platform for notify component.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.discord/
"""
import logging import logging
import asyncio import asyncio
import voluptuous as vol import voluptuous as vol

View File

@ -1,7 +1,8 @@
""" """
Support for Washington State Department of Transportation (WSDOT) data. Support for Washington State Department of Transportation (WSDOT) data.
Data provided by WSDOT is documented at http://wsdot.com/traffic/api/ For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.wsdot/
""" """
import logging import logging
import re import re
@ -17,7 +18,6 @@ from homeassistant.const import (
from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity import Entity
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
CONF_TRAVEL_TIMES = 'travel_time' CONF_TRAVEL_TIMES = 'travel_time'
@ -109,7 +109,7 @@ class WashingtonStateTravelTimeSensor(WashingtonStateTransportSensor):
response = requests.get(self.RESOURCE, params, timeout=10) response = requests.get(self.RESOURCE, params, timeout=10)
if response.status_code != 200: if response.status_code != 200:
_LOGGER.warning('Invalid response from WSDOT API.') _LOGGER.warning("Invalid response from WSDOT API")
else: else:
self._data = response.json() self._data = response.json()
self._state = self._data.get(ATTR_CURRENT_TIME) self._state = self._data.get(ATTR_CURRENT_TIME)

View File

@ -2,7 +2,7 @@
Support for the Amazon Polly text to speech service. Support for the Amazon Polly text to speech service.
For more details about this component, please refer to the documentation at For more details about this component, please refer to the documentation at
https://home-assistant.io/components/tts/amazon_polly/ https://home-assistant.io/components/tts.amazon_polly/
""" """
import logging import logging
import voluptuous as vol import voluptuous as vol

View File

@ -18,7 +18,7 @@ REQUIREMENTS = ['pyzabbix==0.7.4']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
DEFAULT_SSL = False DEFAULT_SSL = False
DEFAULT_PATH = "zabbix" DEFAULT_PATH = 'zabbix'
DOMAIN = 'zabbix' DOMAIN = 'zabbix'