diff --git a/homeassistant/components/device_tracker/linksys_ap.py b/homeassistant/components/device_tracker/linksys_ap.py index 29246f79fc5..fc8f9f96a37 100644 --- a/homeassistant/components/device_tracker/linksys_ap.py +++ b/homeassistant/components/device_tracker/linksys_ap.py @@ -14,11 +14,10 @@ import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.components.device_tracker import DOMAIN, PLATFORM_SCHEMA -from homeassistant.const import (CONF_HOST, CONF_PASSWORD, CONF_USERNAME, - CONF_VERIFY_SSL) +from homeassistant.const import ( + CONF_HOST, CONF_PASSWORD, CONF_USERNAME, CONF_VERIFY_SSL) from homeassistant.util import Throttle -# Return cached results if last scan was less then this time ago. MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5) INTERFACES = 2 DEFAULT_TIMEOUT = 10 @@ -59,7 +58,7 @@ class LinksysAPDeviceScanner(object): # Check if the access point is accessible response = self._make_request() 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): """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 with self.lock: - _LOGGER.info('Checking Linksys AP') + _LOGGER.info("Checking Linksys AP") self.last_results = [] for interface in range(INTERFACES): diff --git a/homeassistant/components/device_tracker/sky_hub.py b/homeassistant/components/device_tracker/sky_hub.py index 9c61b47593e..647731d8485 100644 --- a/homeassistant/components/device_tracker/sky_hub.py +++ b/homeassistant/components/device_tracker/sky_hub.py @@ -1,10 +1,8 @@ """ Support for Sky Hub. -# Example configuration.yaml entry -device_tracker: - - platform: sky_hub - host: 192.168.1.254 +For more details about this platform, please refer to the documentation at +https://home-assistant.io/components/device_tracker.sky_hub/ """ import logging import re @@ -20,13 +18,11 @@ from homeassistant.components.device_tracker import ( from homeassistant.const import CONF_HOST 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__) - _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({ vol.Required(CONF_HOST): cv.string }) @@ -45,7 +41,7 @@ class SkyHubDeviceScanner(DeviceScanner): def __init__(self, config): """Initialise the scanner.""" - _LOGGER.info('Initialising Sky Hub') + _LOGGER.info("Initialising Sky Hub") self.host = config.get(CONF_HOST, '192.168.1.254') self.lock = threading.Lock() @@ -86,7 +82,7 @@ class SkyHubDeviceScanner(DeviceScanner): return False with self.lock: - _LOGGER.info('Scanning') + _LOGGER.info("Scanning") data = _get_skyhub_data(self.url) diff --git a/homeassistant/components/device_tracker/tado.py b/homeassistant/components/device_tracker/tado.py index 5cb1f8fcbd2..9127ef4fad2 100644 --- a/homeassistant/components/device_tracker/tado.py +++ b/homeassistant/components/device_tracker/tado.py @@ -1,8 +1,8 @@ """ Support for Tado Smart Thermostat. -Device tracker platform that supports presence detection. -The detection is based on geofencing enabled devices used with Tado. +For more details about this platform, please refer to the documentation at +https://home-assistant.io/components/device_tracker.tado/ """ import logging from datetime import timedelta @@ -17,15 +17,14 @@ import voluptuous as vol from homeassistant.const import CONF_USERNAME, CONF_PASSWORD import homeassistant.helpers.config_validation as cv from homeassistant.util import Throttle -from homeassistant.components.device_tracker import \ - DOMAIN, PLATFORM_SCHEMA, DeviceScanner +from homeassistant.components.device_tracker import ( + DOMAIN, PLATFORM_SCHEMA, DeviceScanner) 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__) +MIN_TIME_BETWEEN_SCANS = timedelta(seconds=30) + PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ vol.Required(CONF_PASSWORD): cv.string, vol.Required(CONF_USERNAME): cv.string diff --git a/homeassistant/components/light/avion.py b/homeassistant/components/light/avion.py index 4a53697ccf4..929b2bc33ac 100644 --- a/homeassistant/components/light/avion.py +++ b/homeassistant/components/light/avion.py @@ -55,7 +55,7 @@ class AvionLight(Light): self._name = device['name'] self._address = device['address'] - self._key = device["key"] + self._key = device['key'] self._brightness = 255 self._state = False self._switch = avion.avion(self._address, self._key) diff --git a/homeassistant/components/lutron.py b/homeassistant/components/lutron.py index 0c9458ff3f6..d5512e9e5b6 100644 --- a/homeassistant/components/lutron.py +++ b/homeassistant/components/lutron.py @@ -1,9 +1,9 @@ """ 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 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#' 'pylutron==0.1.0'] -DOMAIN = "lutron" +DOMAIN = 'lutron' _LOGGER = logging.getLogger(__name__) @@ -38,7 +38,7 @@ def setup(hass, base_config): ) hass.data[LUTRON_CONTROLLER].load_xml_db() 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') diff --git a/homeassistant/components/notify/discord.py b/homeassistant/components/notify/discord.py index 34fb2a1770a..e6c4b3bad96 100644 --- a/homeassistant/components/notify/discord.py +++ b/homeassistant/components/notify/discord.py @@ -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 asyncio import voluptuous as vol diff --git a/homeassistant/components/sensor/wsdot.py b/homeassistant/components/sensor/wsdot.py index a3230a88eb3..fecff260716 100644 --- a/homeassistant/components/sensor/wsdot.py +++ b/homeassistant/components/sensor/wsdot.py @@ -1,7 +1,8 @@ """ 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 re @@ -17,7 +18,6 @@ from homeassistant.const import ( from homeassistant.helpers.entity import Entity import homeassistant.helpers.config_validation as cv - _LOGGER = logging.getLogger(__name__) CONF_TRAVEL_TIMES = 'travel_time' @@ -109,7 +109,7 @@ class WashingtonStateTravelTimeSensor(WashingtonStateTransportSensor): response = requests.get(self.RESOURCE, params, timeout=10) if response.status_code != 200: - _LOGGER.warning('Invalid response from WSDOT API.') + _LOGGER.warning("Invalid response from WSDOT API") else: self._data = response.json() self._state = self._data.get(ATTR_CURRENT_TIME) diff --git a/homeassistant/components/tts/amazon_polly.py b/homeassistant/components/tts/amazon_polly.py index fe63d72b632..e40c10f5e14 100644 --- a/homeassistant/components/tts/amazon_polly.py +++ b/homeassistant/components/tts/amazon_polly.py @@ -2,7 +2,7 @@ Support for the Amazon Polly text to speech service. 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 voluptuous as vol diff --git a/homeassistant/components/zabbix.py b/homeassistant/components/zabbix.py index 3418bad6c9c..adbf34a474c 100644 --- a/homeassistant/components/zabbix.py +++ b/homeassistant/components/zabbix.py @@ -18,7 +18,7 @@ REQUIREMENTS = ['pyzabbix==0.7.4'] _LOGGER = logging.getLogger(__name__) DEFAULT_SSL = False -DEFAULT_PATH = "zabbix" +DEFAULT_PATH = 'zabbix' DOMAIN = 'zabbix'