diff --git a/homeassistant/components/abode/__init__.py b/homeassistant/components/abode/__init__.py index 8a1a39a726f..71a1dcdd590 100644 --- a/homeassistant/components/abode/__init__.py +++ b/homeassistant/components/abode/__init__.py @@ -1,9 +1,4 @@ -""" -This component provides basic support for Abode Home Security system. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/abode/ -""" +"""Support for Abode Home Security system.""" import logging from functools import partial from requests.exceptions import HTTPError, ConnectTimeout diff --git a/homeassistant/components/abode/alarm_control_panel.py b/homeassistant/components/abode/alarm_control_panel.py index 947e2916300..ec5038a7a84 100644 --- a/homeassistant/components/abode/alarm_control_panel.py +++ b/homeassistant/components/abode/alarm_control_panel.py @@ -1,9 +1,4 @@ -""" -This component provides HA alarm_control_panel support for Abode System. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/alarm_control_panel.abode/ -""" +"""Support for Abode Security System alarm control panels.""" import logging import homeassistant.components.alarm_control_panel as alarm diff --git a/homeassistant/components/abode/binary_sensor.py b/homeassistant/components/abode/binary_sensor.py index a821abf445b..47baef1d7e5 100644 --- a/homeassistant/components/abode/binary_sensor.py +++ b/homeassistant/components/abode/binary_sensor.py @@ -1,20 +1,14 @@ -""" -This component provides HA binary_sensor support for Abode Security System. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.abode/ -""" +"""Support for Abode Security System binary sensors.""" import logging from homeassistant.components.abode import (AbodeDevice, AbodeAutomation, DOMAIN as ABODE_DOMAIN) from homeassistant.components.binary_sensor import BinarySensorDevice +_LOGGER = logging.getLogger(__name__) DEPENDENCIES = ['abode'] -_LOGGER = logging.getLogger(__name__) - def setup_platform(hass, config, add_entities, discovery_info=None): """Set up a sensor for an Abode device.""" diff --git a/homeassistant/components/abode/camera.py b/homeassistant/components/abode/camera.py index 39681760d4d..99613d07c47 100644 --- a/homeassistant/components/abode/camera.py +++ b/homeassistant/components/abode/camera.py @@ -1,9 +1,4 @@ -""" -This component provides HA camera support for Abode Security System. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/camera.abode/ -""" +"""Support for Abode Security System cameras.""" import logging from datetime import timedelta @@ -13,7 +8,6 @@ from homeassistant.components.abode import AbodeDevice, DOMAIN as ABODE_DOMAIN from homeassistant.components.camera import Camera from homeassistant.util import Throttle - DEPENDENCIES = ['abode'] MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=90) diff --git a/homeassistant/components/abode/cover.py b/homeassistant/components/abode/cover.py index 3ba3fb118f3..03d6219ebce 100644 --- a/homeassistant/components/abode/cover.py +++ b/homeassistant/components/abode/cover.py @@ -1,15 +1,9 @@ -""" -This component provides HA cover support for Abode Security System. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/cover.abode/ -""" +"""Support for Abode Security System covers.""" import logging from homeassistant.components.abode import AbodeDevice, DOMAIN as ABODE_DOMAIN from homeassistant.components.cover import CoverDevice - DEPENDENCIES = ['abode'] _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/abode/light.py b/homeassistant/components/abode/light.py index 397d61f3073..aabf5fbccdc 100644 --- a/homeassistant/components/abode/light.py +++ b/homeassistant/components/abode/light.py @@ -1,9 +1,4 @@ -""" -This component provides HA light support for Abode Security System. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/light.abode/ -""" +"""Support for Abode Security System lights.""" import logging from math import ceil from homeassistant.components.abode import AbodeDevice, DOMAIN as ABODE_DOMAIN diff --git a/homeassistant/components/abode/lock.py b/homeassistant/components/abode/lock.py index a8777ccb503..ce6634268e9 100644 --- a/homeassistant/components/abode/lock.py +++ b/homeassistant/components/abode/lock.py @@ -1,15 +1,9 @@ -""" -This component provides HA lock support for Abode Security System. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/lock.abode/ -""" +"""Support for Abode Security System locks.""" import logging from homeassistant.components.abode import AbodeDevice, DOMAIN as ABODE_DOMAIN from homeassistant.components.lock import LockDevice - DEPENDENCIES = ['abode'] _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/abode/sensor.py b/homeassistant/components/abode/sensor.py index 4695a5f0471..fa6cb9323bf 100644 --- a/homeassistant/components/abode/sensor.py +++ b/homeassistant/components/abode/sensor.py @@ -1,9 +1,4 @@ -""" -Support for Abode Security System sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.abode/ -""" +"""Support for Abode Security System sensors.""" import logging from homeassistant.components.abode import AbodeDevice, DOMAIN as ABODE_DOMAIN diff --git a/homeassistant/components/abode/switch.py b/homeassistant/components/abode/switch.py index e3f993e5413..d5303a27cd2 100644 --- a/homeassistant/components/abode/switch.py +++ b/homeassistant/components/abode/switch.py @@ -1,20 +1,14 @@ -""" -This component provides HA switch support for Abode Security System. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.abode/ -""" +"""Support for Abode Security System switches.""" import logging from homeassistant.components.abode import (AbodeDevice, AbodeAutomation, DOMAIN as ABODE_DOMAIN) from homeassistant.components.switch import SwitchDevice +_LOGGER = logging.getLogger(__name__) DEPENDENCIES = ['abode'] -_LOGGER = logging.getLogger(__name__) - def setup_platform(hass, config, add_entities, discovery_info=None): """Set up Abode switch devices.""" diff --git a/homeassistant/components/ads/__init__.py b/homeassistant/components/ads/__init__.py index 360236790f8..48b5ea21cbc 100644 --- a/homeassistant/components/ads/__init__.py +++ b/homeassistant/components/ads/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Automation Device Specification (ADS). - -For more details about this component, please refer to the documentation. -https://home-assistant.io/components/ads/ -""" +"""Support for Automation Device Specification (ADS).""" import threading import struct import logging diff --git a/homeassistant/components/ads/binary_sensor.py b/homeassistant/components/ads/binary_sensor.py index c83837dcd5f..6771e99cd77 100644 --- a/homeassistant/components/ads/binary_sensor.py +++ b/homeassistant/components/ads/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for ADS binary sensors. - -For more details about this platform, please refer to the documentation. -https://home-assistant.io/components/binary_sensor.ads/ -""" +"""Support for ADS binary sensors.""" import logging import voluptuous as vol diff --git a/homeassistant/components/ads/light.py b/homeassistant/components/ads/light.py index a2d54fe7d4a..e5299821e39 100644 --- a/homeassistant/components/ads/light.py +++ b/homeassistant/components/ads/light.py @@ -1,10 +1,4 @@ -""" -Support for ADS light sources. - -For more details about this platform, please refer to the documentation. -https://home-assistant.io/components/light.ads/ - -""" +"""Support for ADS light sources.""" import logging import voluptuous as vol from homeassistant.components.light import Light, ATTR_BRIGHTNESS, \ diff --git a/homeassistant/components/ads/sensor.py b/homeassistant/components/ads/sensor.py index 50f3fd08d5c..2972f50d804 100644 --- a/homeassistant/components/ads/sensor.py +++ b/homeassistant/components/ads/sensor.py @@ -1,9 +1,4 @@ -""" -Support for ADS sensors. - -For more details about this platform, please refer to the documentation. -https://home-assistant.io/components/sensor.ads/ -""" +"""Support for ADS sensors.""" import logging import voluptuous as vol diff --git a/homeassistant/components/ads/switch.py b/homeassistant/components/ads/switch.py index ab9e54adaa7..e3aee023f21 100644 --- a/homeassistant/components/ads/switch.py +++ b/homeassistant/components/ads/switch.py @@ -1,9 +1,4 @@ -""" -Support for ADS switch platform. - -For more details about this platform, please refer to the documentation. -https://home-assistant.io/components/switch.ads/ -""" +"""Support for ADS switch platform.""" import logging import voluptuous as vol @@ -37,7 +32,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): class AdsSwitch(ToggleEntity): - """Representation of an Ads switch device.""" + """Representation of an ADS switch device.""" def __init__(self, ads_hub, name, ads_var): """Initialize the AdsSwitch entity.""" @@ -51,7 +46,7 @@ class AdsSwitch(ToggleEntity): """Register device notification.""" def update(name, value): """Handle device notification.""" - _LOGGER.debug('Variable %s changed its value to %d', name, value) + _LOGGER.debug("Variable %s changed its value to %d", name, value) self._on_state = value self.schedule_update_ha_state() diff --git a/homeassistant/components/alarmdecoder/__init__.py b/homeassistant/components/alarmdecoder/__init__.py index 92eab728210..1f74d72809b 100644 --- a/homeassistant/components/alarmdecoder/__init__.py +++ b/homeassistant/components/alarmdecoder/__init__.py @@ -1,9 +1,4 @@ -""" -Support for AlarmDecoder devices. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/alarmdecoder/ -""" +"""Support for AlarmDecoder devices.""" import logging from datetime import timedelta diff --git a/homeassistant/components/alarmdecoder/alarm_control_panel.py b/homeassistant/components/alarmdecoder/alarm_control_panel.py index 16e82280433..986907622b1 100644 --- a/homeassistant/components/alarmdecoder/alarm_control_panel.py +++ b/homeassistant/components/alarmdecoder/alarm_control_panel.py @@ -1,9 +1,4 @@ -""" -Support for AlarmDecoder-based alarm control panels (Honeywell/DSC). - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/alarm_control_panel.alarmdecoder/ -""" +"""Support for AlarmDecoder-based alarm control panels (Honeywell/DSC).""" import logging import voluptuous as vol diff --git a/homeassistant/components/alarmdecoder/binary_sensor.py b/homeassistant/components/alarmdecoder/binary_sensor.py index d8fddeaa540..c5af6ea79cb 100644 --- a/homeassistant/components/alarmdecoder/binary_sensor.py +++ b/homeassistant/components/alarmdecoder/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for AlarmDecoder zone states- represented as binary sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.alarmdecoder/ -""" +"""Support for AlarmDecoder zone states- represented as binary sensors.""" import logging from homeassistant.components.binary_sensor import BinarySensorDevice diff --git a/homeassistant/components/alarmdecoder/sensor.py b/homeassistant/components/alarmdecoder/sensor.py index 546d09299dc..b2f697ea83f 100644 --- a/homeassistant/components/alarmdecoder/sensor.py +++ b/homeassistant/components/alarmdecoder/sensor.py @@ -1,9 +1,4 @@ -""" -Support for AlarmDecoder Sensors (Shows Panel Display). - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.alarmdecoder/ -""" +"""Support for AlarmDecoder sensors (Shows Panel Display).""" import logging from homeassistant.helpers.entity import Entity diff --git a/homeassistant/components/alert/__init__.py b/homeassistant/components/alert/__init__.py index 579a19c1b52..f92fd6b187b 100644 --- a/homeassistant/components/alert/__init__.py +++ b/homeassistant/components/alert/__init__.py @@ -1,9 +1,4 @@ -""" -Support for repeating alerts when conditions are met. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/alert/ -""" +"""Support for repeating alerts when conditions are met.""" import asyncio import logging from datetime import datetime, timedelta diff --git a/homeassistant/components/alexa/__init__.py b/homeassistant/components/alexa/__init__.py index 8491268dfd6..062d698d512 100644 --- a/homeassistant/components/alexa/__init__.py +++ b/homeassistant/components/alexa/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Alexa skill service end point. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/alexa/ -""" +"""Support for Alexa skill service end point.""" import logging import voluptuous as vol @@ -57,7 +52,7 @@ CONFIG_SCHEMA = vol.Schema({ async def async_setup(hass, config): - """Activate Alexa component.""" + """Activate the Alexa component.""" config = config.get(DOMAIN, {}) flash_briefings_config = config.get(CONF_FLASH_BRIEFINGS) diff --git a/homeassistant/components/alexa/auth.py b/homeassistant/components/alexa/auth.py index 978cb611895..6918ec1e54f 100644 --- a/homeassistant/components/alexa/auth.py +++ b/homeassistant/components/alexa/auth.py @@ -1,5 +1,4 @@ """Support for Alexa skill auth.""" - import asyncio import json import logging diff --git a/homeassistant/components/alexa/flash_briefings.py b/homeassistant/components/alexa/flash_briefings.py index 02f47b05617..537f04b20be 100644 --- a/homeassistant/components/alexa/flash_briefings.py +++ b/homeassistant/components/alexa/flash_briefings.py @@ -1,9 +1,4 @@ -""" -Support for Alexa skill service end point. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/alexa/ -""" +"""Support for Alexa skill service end point.""" import copy from datetime import datetime import logging diff --git a/homeassistant/components/alexa/intent.py b/homeassistant/components/alexa/intent.py index 85cb4f105cd..b30a7238b3e 100644 --- a/homeassistant/components/alexa/intent.py +++ b/homeassistant/components/alexa/intent.py @@ -1,9 +1,4 @@ -""" -Support for Alexa skill service end point. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/alexa/ -""" +"""Support for Alexa skill service end point.""" import enum import logging diff --git a/homeassistant/components/alexa/smart_home.py b/homeassistant/components/alexa/smart_home.py index acb23fe4278..4e2383bb43d 100644 --- a/homeassistant/components/alexa/smart_home.py +++ b/homeassistant/components/alexa/smart_home.py @@ -1,10 +1,4 @@ -"""Support for alexa Smart Home Skill API. - -API documentation: -https://developer.amazon.com/docs/smarthome/understand-the-smart-home-skill-api.html -https://developer.amazon.com/docs/device-apis/message-guide.html -""" - +"""Support for alexa Smart Home Skill API.""" import asyncio from collections import OrderedDict from datetime import datetime @@ -67,7 +61,7 @@ API_THERMOSTAT_MODES = OrderedDict([ (climate.STATE_OFF, 'OFF'), (climate.STATE_IDLE, 'OFF'), (climate.STATE_FAN_ONLY, 'OFF'), - (climate.STATE_DRY, 'OFF') + (climate.STATE_DRY, 'OFF'), ]) SMART_HOME_HTTP_ENDPOINT = '/api/alexa/smart_home' diff --git a/homeassistant/components/ambient_station/__init__.py b/homeassistant/components/ambient_station/__init__.py index 71d946b4bf5..5972660c6e6 100644 --- a/homeassistant/components/ambient_station/__init__.py +++ b/homeassistant/components/ambient_station/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Ambient Weather Station Service. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/ambient_station/ -""" +"""Support for Ambient Weather Station Service.""" import logging import voluptuous as vol @@ -26,6 +21,7 @@ from .const import ( TYPE_BINARY_SENSOR, TYPE_SENSOR) REQUIREMENTS = ['aioambient==0.1.1'] + _LOGGER = logging.getLogger(__name__) DATA_CONFIG = 'config' diff --git a/homeassistant/components/ambient_station/binary_sensor.py b/homeassistant/components/ambient_station/binary_sensor.py index 9d3b90a08a1..2defa032809 100644 --- a/homeassistant/components/ambient_station/binary_sensor.py +++ b/homeassistant/components/ambient_station/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for Ambient Weather Station binary sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.ambient_station/ -""" +"""Support for Ambient Weather Station binary sensors.""" import logging from homeassistant.components.ambient_station import ( @@ -15,9 +10,10 @@ from homeassistant.const import ATTR_NAME from .const import ATTR_LAST_DATA, DATA_CLIENT, DOMAIN, TYPE_BINARY_SENSOR -DEPENDENCIES = ['ambient_station'] _LOGGER = logging.getLogger(__name__) +DEPENDENCIES = ['ambient_station'] + async def async_setup_platform( hass, config, async_add_entities, discovery_info=None): diff --git a/homeassistant/components/ambient_station/config_flow.py b/homeassistant/components/ambient_station/config_flow.py index 56e747ce5e0..f01bfd8f791 100644 --- a/homeassistant/components/ambient_station/config_flow.py +++ b/homeassistant/components/ambient_station/config_flow.py @@ -1,5 +1,4 @@ """Config flow to configure the Ambient PWS component.""" - import voluptuous as vol from homeassistant import config_entries diff --git a/homeassistant/components/ambient_station/sensor.py b/homeassistant/components/ambient_station/sensor.py index 2699975cfb5..fa3222bf0e4 100644 --- a/homeassistant/components/ambient_station/sensor.py +++ b/homeassistant/components/ambient_station/sensor.py @@ -1,9 +1,4 @@ -""" -Support for Ambient Weather Station sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.ambient_station/ -""" +"""Support for Ambient Weather Station sensors.""" import logging from homeassistant.components.ambient_station import ( @@ -12,9 +7,10 @@ from homeassistant.const import ATTR_NAME from .const import ATTR_LAST_DATA, DATA_CLIENT, DOMAIN, TYPE_SENSOR -DEPENDENCIES = ['ambient_station'] _LOGGER = logging.getLogger(__name__) +DEPENDENCIES = ['ambient_station'] + async def async_setup_platform( hass, config, async_add_entities, discovery_info=None): diff --git a/homeassistant/components/amcrest/__init__.py b/homeassistant/components/amcrest/__init__.py index bcd0c38c3bd..49f11570b21 100644 --- a/homeassistant/components/amcrest/__init__.py +++ b/homeassistant/components/amcrest/__init__.py @@ -1,9 +1,4 @@ -""" -This component provides basic support for Amcrest IP cameras. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/amcrest/ -""" +"""Support for Amcrest IP cameras.""" import logging from datetime import timedelta diff --git a/homeassistant/components/amcrest/camera.py b/homeassistant/components/amcrest/camera.py index 3b3368c2f5c..7c943b89734 100644 --- a/homeassistant/components/amcrest/camera.py +++ b/homeassistant/components/amcrest/camera.py @@ -1,9 +1,4 @@ -""" -This component provides basic support for Amcrest IP cameras. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/camera.amcrest/ -""" +"""Support for Amcrest IP cameras.""" import logging from homeassistant.components.amcrest import ( diff --git a/homeassistant/components/amcrest/sensor.py b/homeassistant/components/amcrest/sensor.py index 22e13d05e20..4869dfffa6e 100644 --- a/homeassistant/components/amcrest/sensor.py +++ b/homeassistant/components/amcrest/sensor.py @@ -1,9 +1,4 @@ -""" -This component provides HA sensor support for Amcrest IP cameras. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.amcrest/ -""" +"""Suppoort for Amcrest IP camera sensors.""" from datetime import timedelta import logging @@ -18,8 +13,8 @@ _LOGGER = logging.getLogger(__name__) SCAN_INTERVAL = timedelta(seconds=10) -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up a sensor for an Amcrest IP Camera.""" if discovery_info is None: return @@ -45,8 +40,8 @@ class AmcrestSensor(Entity): self._attrs = {} self._camera = camera self._sensor_type = sensor_type - self._name = '{0}_{1}'.format(name, - SENSORS.get(self._sensor_type)[0]) + self._name = '{0}_{1}'.format( + name, SENSORS.get(self._sensor_type)[0]) self._icon = 'mdi:{}'.format(SENSORS.get(self._sensor_type)[2]) self._state = None diff --git a/homeassistant/components/amcrest/switch.py b/homeassistant/components/amcrest/switch.py index 4eb20308850..3c1f03f0145 100644 --- a/homeassistant/components/amcrest/switch.py +++ b/homeassistant/components/amcrest/switch.py @@ -1,9 +1,4 @@ -""" -Support for toggling Amcrest IP camera settings. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.amcrest/ -""" +"""Support for toggling Amcrest IP camera settings.""" import logging from homeassistant.components.amcrest import DATA_AMCREST, SWITCHES @@ -16,8 +11,8 @@ _LOGGER = logging.getLogger(__name__) DEPENDENCIES = ['amcrest'] -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up the IP Amcrest camera switch platform.""" if discovery_info is None: return diff --git a/homeassistant/components/android_ip_webcam/__init__.py b/homeassistant/components/android_ip_webcam/__init__.py index 1cf46174371..c5424b3d0fa 100644 --- a/homeassistant/components/android_ip_webcam/__init__.py +++ b/homeassistant/components/android_ip_webcam/__init__.py @@ -1,9 +1,4 @@ -""" -Support for IP Webcam, an Android app that acts as a full-featured webcam. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/android_ip_webcam/ -""" +"""Support for Android IP Webcam.""" import asyncio import logging from datetime import timedelta diff --git a/homeassistant/components/android_ip_webcam/binary_sensor.py b/homeassistant/components/android_ip_webcam/binary_sensor.py index 085bafd3ae3..e33e22f3778 100644 --- a/homeassistant/components/android_ip_webcam/binary_sensor.py +++ b/homeassistant/components/android_ip_webcam/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for IP Webcam binary sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.android_ip_webcam/ -""" +"""Support for Android IP Webcam binary sensors.""" from homeassistant.components.binary_sensor import BinarySensorDevice from homeassistant.components.android_ip_webcam import ( KEY_MAP, DATA_IP_WEBCAM, AndroidIPCamEntity, CONF_HOST, CONF_NAME) @@ -11,8 +6,8 @@ from homeassistant.components.android_ip_webcam import ( DEPENDENCIES = ['android_ip_webcam'] -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up the IP Webcam binary sensors.""" if discovery_info is None: return diff --git a/homeassistant/components/android_ip_webcam/sensor.py b/homeassistant/components/android_ip_webcam/sensor.py index 0f795f85dcd..e98ce7951b8 100644 --- a/homeassistant/components/android_ip_webcam/sensor.py +++ b/homeassistant/components/android_ip_webcam/sensor.py @@ -1,10 +1,4 @@ -""" -Support for IP Webcam sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.android_ip_webcam/ -""" - +"""Support for Android IP Webcam sensors.""" from homeassistant.components.android_ip_webcam import ( KEY_MAP, ICON_MAP, DATA_IP_WEBCAM, AndroidIPCamEntity, CONF_HOST, CONF_NAME, CONF_SENSORS) @@ -13,8 +7,8 @@ from homeassistant.helpers.icon import icon_for_battery_level DEPENDENCIES = ['android_ip_webcam'] -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up the IP Webcam Sensor.""" if discovery_info is None: return diff --git a/homeassistant/components/android_ip_webcam/switch.py b/homeassistant/components/android_ip_webcam/switch.py index f770b9d5ebf..73a94acbcdd 100644 --- a/homeassistant/components/android_ip_webcam/switch.py +++ b/homeassistant/components/android_ip_webcam/switch.py @@ -1,10 +1,4 @@ -""" -Support for IP Webcam settings. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.android_ip_webcam/ -""" - +"""Support for Android IP Webcam settings.""" from homeassistant.components.switch import SwitchDevice from homeassistant.components.android_ip_webcam import ( KEY_MAP, ICON_MAP, DATA_IP_WEBCAM, AndroidIPCamEntity, CONF_HOST, @@ -13,8 +7,8 @@ from homeassistant.components.android_ip_webcam import ( DEPENDENCIES = ['android_ip_webcam'] -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up the IP Webcam switch platform.""" if discovery_info is None: return diff --git a/homeassistant/components/apcupsd/__init__.py b/homeassistant/components/apcupsd/__init__.py index 79b88378169..aab6f6dda01 100644 --- a/homeassistant/components/apcupsd/__init__.py +++ b/homeassistant/components/apcupsd/__init__.py @@ -1,9 +1,4 @@ -""" -Support for status output of APCUPSd via its Network Information Server (NIS). - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/apcupsd/ -""" +"""Support for APCUPSd via its Network Information Server (NIS).""" import logging from datetime import timedelta diff --git a/homeassistant/components/apcupsd/binary_sensor.py b/homeassistant/components/apcupsd/binary_sensor.py index f876b8cc34b..445dab9b074 100644 --- a/homeassistant/components/apcupsd/binary_sensor.py +++ b/homeassistant/components/apcupsd/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for tracking the online status of a UPS. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.apcupsd/ -""" +"""Support for tracking the online status of a UPS.""" import voluptuous as vol from homeassistant.components.binary_sensor import ( diff --git a/homeassistant/components/apcupsd/sensor.py b/homeassistant/components/apcupsd/sensor.py index 90c1f2e6795..4ebe0ac8aaf 100644 --- a/homeassistant/components/apcupsd/sensor.py +++ b/homeassistant/components/apcupsd/sensor.py @@ -1,9 +1,4 @@ -""" -Provides a sensor to track various status aspects of a UPS. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.apcupsd/ -""" +"""Support for APCUPSd sensors.""" import logging import voluptuous as vol diff --git a/homeassistant/components/api/__init__.py b/homeassistant/components/api/__init__.py index 961350bfa89..7639ac621fe 100644 --- a/homeassistant/components/api/__init__.py +++ b/homeassistant/components/api/__init__.py @@ -1,9 +1,4 @@ -""" -Rest API for Home Assistant. - -For more details about the RESTful API, please refer to the documentation at -https://developers.home-assistant.io/docs/en/external_api_rest.html -""" +"""Rest API for Home Assistant.""" import asyncio import json import logging diff --git a/homeassistant/components/apple_tv/__init__.py b/homeassistant/components/apple_tv/__init__.py index 73cabdfbae6..b265dc533eb 100644 --- a/homeassistant/components/apple_tv/__init__.py +++ b/homeassistant/components/apple_tv/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Apple TV. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/apple_tv/ -""" +"""Support for Apple TV.""" import asyncio import logging from typing import Sequence, TypeVar, Union diff --git a/homeassistant/components/apple_tv/media_player.py b/homeassistant/components/apple_tv/media_player.py index 0b38a256e40..03ac5bd2549 100644 --- a/homeassistant/components/apple_tv/media_player.py +++ b/homeassistant/components/apple_tv/media_player.py @@ -1,9 +1,4 @@ -""" -Support for Apple TV. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/media_player.apple_tv/ -""" +"""Support for Apple TV media player.""" import logging from homeassistant.components.apple_tv import ( diff --git a/homeassistant/components/apple_tv/remote.py b/homeassistant/components/apple_tv/remote.py index 72696143bfe..2d80ded6861 100644 --- a/homeassistant/components/apple_tv/remote.py +++ b/homeassistant/components/apple_tv/remote.py @@ -1,21 +1,14 @@ -""" -Remote control support for Apple TV. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/remote.apple_tv/ -""" - +"""Remote control support for Apple TV.""" from homeassistant.components.apple_tv import ( ATTR_ATV, ATTR_POWER, DATA_APPLE_TV) from homeassistant.components import remote from homeassistant.const import (CONF_NAME, CONF_HOST) - DEPENDENCIES = ['apple_tv'] -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up the Apple TV remote platform.""" if not discovery_info: return diff --git a/homeassistant/components/aqualogic/__init__.py b/homeassistant/components/aqualogic/__init__.py index abb61d42ca3..a4f83b573f7 100644 --- a/homeassistant/components/aqualogic/__init__.py +++ b/homeassistant/components/aqualogic/__init__.py @@ -1,9 +1,4 @@ -""" -Support for AquaLogic component. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/aqualogic/ -""" +"""Support for AquaLogic devices.""" from datetime import timedelta import logging import time @@ -20,15 +15,15 @@ REQUIREMENTS = ["aqualogic==1.0"] _LOGGER = logging.getLogger(__name__) -DOMAIN = "aqualogic" -UPDATE_TOPIC = DOMAIN + "_update" -CONF_UNIT = "unit" +DOMAIN = 'aqualogic' +UPDATE_TOPIC = DOMAIN + '_update' +CONF_UNIT = 'unit' RECONNECT_INTERVAL = timedelta(seconds=10) CONFIG_SCHEMA = vol.Schema({ DOMAIN: vol.Schema({ vol.Required(CONF_HOST): cv.string, - vol.Required(CONF_PORT): cv.port + vol.Required(CONF_PORT): cv.port, }), }, extra=vol.ALLOW_EXTRA) @@ -39,10 +34,8 @@ def setup(hass, config): port = config[DOMAIN][CONF_PORT] processor = AquaLogicProcessor(hass, host, port) hass.data[DOMAIN] = processor - hass.bus.listen_once(EVENT_HOMEASSISTANT_START, - processor.start_listen) - hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, - processor.shutdown) + hass.bus.listen_once(EVENT_HOMEASSISTANT_START, processor.start_listen) + hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, processor.shutdown) _LOGGER.debug("AquaLogicProcessor %s:%i initialized", host, port) return True @@ -85,8 +78,7 @@ class AquaLogicProcessor(threading.Thread): if self._shutdown: return - _LOGGER.error("Connection to %s:%d lost", - self._host, self._port) + _LOGGER.error("Connection to %s:%d lost", self._host, self._port) time.sleep(RECONNECT_INTERVAL.seconds) @property diff --git a/homeassistant/components/aqualogic/sensor.py b/homeassistant/components/aqualogic/sensor.py index f10fd05b83f..9e061ba91bf 100644 --- a/homeassistant/components/aqualogic/sensor.py +++ b/homeassistant/components/aqualogic/sensor.py @@ -1,9 +1,4 @@ -""" -Support for AquaLogic sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.aqualogic/ -""" +"""Support for AquaLogic sensors.""" import logging import voluptuous as vol @@ -46,8 +41,8 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ }) -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up the sensor platform.""" sensors = [] diff --git a/homeassistant/components/aqualogic/switch.py b/homeassistant/components/aqualogic/switch.py index 48c4702aca0..ee040fa1ba5 100644 --- a/homeassistant/components/aqualogic/switch.py +++ b/homeassistant/components/aqualogic/switch.py @@ -1,9 +1,4 @@ -""" -Support for AquaLogic switches. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.aqualogic/ -""" +"""Support for AquaLogic switches.""" import logging import voluptuous as vol @@ -37,8 +32,8 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ }) -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up the switch platform.""" switches = [] diff --git a/homeassistant/components/arduino/__init__.py b/homeassistant/components/arduino/__init__.py index 785f8c57f94..351122e74f0 100644 --- a/homeassistant/components/arduino/__init__.py +++ b/homeassistant/components/arduino/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Arduino boards running with the Firmata firmware. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/arduino/ -""" +"""Support for Arduino boards running with the Firmata firmware.""" import logging import voluptuous as vol diff --git a/homeassistant/components/arduino/sensor.py b/homeassistant/components/arduino/sensor.py index f46eebce1b2..ff758ea5847 100644 --- a/homeassistant/components/arduino/sensor.py +++ b/homeassistant/components/arduino/sensor.py @@ -1,11 +1,4 @@ -""" -Support for getting information from Arduino pins. - -Only analog pins are supported. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.arduino/ -""" +"""Support for getting information from Arduino pins.""" import logging import voluptuous as vol diff --git a/homeassistant/components/arduino/switch.py b/homeassistant/components/arduino/switch.py index ee8f0e878a3..947c5188766 100644 --- a/homeassistant/components/arduino/switch.py +++ b/homeassistant/components/arduino/switch.py @@ -1,11 +1,4 @@ -""" -Support for switching Arduino pins on and off. - -So far only digital pins are supported. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.arduino/ -""" +"""Support for switching Arduino pins on and off.""" import logging import voluptuous as vol diff --git a/homeassistant/components/arlo/__init__.py b/homeassistant/components/arlo/__init__.py index aebd57098b5..7e81836e522 100644 --- a/homeassistant/components/arlo/__init__.py +++ b/homeassistant/components/arlo/__init__.py @@ -1,9 +1,4 @@ -""" -This component provides support for Netgear Arlo IP cameras. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/arlo/ -""" +"""Support for Netgear Arlo IP cameras.""" import logging from datetime import timedelta diff --git a/homeassistant/components/arlo/alarm_control_panel.py b/homeassistant/components/arlo/alarm_control_panel.py index 66f11fab83f..8c21a448a23 100644 --- a/homeassistant/components/arlo/alarm_control_panel.py +++ b/homeassistant/components/arlo/alarm_control_panel.py @@ -1,9 +1,4 @@ -""" -Support for Arlo Alarm Control Panels. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/alarm_control_panel.arlo/ -""" +"""Support for Arlo Alarm Control Panels.""" import logging import voluptuous as vol diff --git a/homeassistant/components/arlo/camera.py b/homeassistant/components/arlo/camera.py index 7857995b4af..6f20ecdadcd 100644 --- a/homeassistant/components/arlo/camera.py +++ b/homeassistant/components/arlo/camera.py @@ -1,9 +1,4 @@ -""" -Support for Netgear Arlo IP cameras. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/camera.arlo/ -""" +"""Support for Netgear Arlo IP cameras.""" import logging import voluptuous as vol diff --git a/homeassistant/components/arlo/sensor.py b/homeassistant/components/arlo/sensor.py index be940cc4f51..3ad7b70a947 100644 --- a/homeassistant/components/arlo/sensor.py +++ b/homeassistant/components/arlo/sensor.py @@ -1,9 +1,4 @@ -""" -This component provides HA sensor for Netgear Arlo IP cameras. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.arlo/ -""" +"""Sensor support for Netgear Arlo IP cameras.""" import logging import voluptuous as vol diff --git a/homeassistant/components/asterisk_mbox/__init__.py b/homeassistant/components/asterisk_mbox/__init__.py index 406774d5fad..d8d3b194cd7 100644 --- a/homeassistant/components/asterisk_mbox/__init__.py +++ b/homeassistant/components/asterisk_mbox/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Asterisk Voicemail interface. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/asterisk_mbox/ -""" +"""Support for Asterisk Voicemail interface.""" import logging import voluptuous as vol @@ -78,9 +73,8 @@ class AsteriskData: @callback def handle_data(self, command, msg): """Handle changes to the mailbox.""" - from asterisk_mbox.commands import (CMD_MESSAGE_LIST, - CMD_MESSAGE_CDR_AVAILABLE, - CMD_MESSAGE_CDR) + from asterisk_mbox.commands import ( + CMD_MESSAGE_LIST, CMD_MESSAGE_CDR_AVAILABLE, CMD_MESSAGE_CDR) if command == CMD_MESSAGE_LIST: _LOGGER.debug("AsteriskVM sent updated message list: Len %d", @@ -89,8 +83,8 @@ class AsteriskData: self.messages = sorted( msg, key=lambda item: item['info']['origtime'], reverse=True) if not isinstance(old_messages, list): - async_dispatcher_send(self.hass, SIGNAL_DISCOVER_PLATFORM, - DOMAIN) + async_dispatcher_send( + self.hass, SIGNAL_DISCOVER_PLATFORM, DOMAIN) async_dispatcher_send(self.hass, SIGNAL_MESSAGE_UPDATE, self.messages) elif command == CMD_MESSAGE_CDR: diff --git a/homeassistant/components/asterisk_mbox/mailbox.py b/homeassistant/components/asterisk_mbox/mailbox.py index 087018084f2..9da4bd1a21a 100644 --- a/homeassistant/components/asterisk_mbox/mailbox.py +++ b/homeassistant/components/asterisk_mbox/mailbox.py @@ -1,9 +1,4 @@ -""" -Asterisk Voicemail interface. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/mailbox.asteriskvm/ -""" +"""Support for the Asterisk Voicemail interface.""" import logging from homeassistant.components.asterisk_mbox import DOMAIN as ASTERISK_DOMAIN diff --git a/homeassistant/components/asuswrt/__init__.py b/homeassistant/components/asuswrt/__init__.py index 0069b3c0d73..3fc0e9d6476 100644 --- a/homeassistant/components/asuswrt/__init__.py +++ b/homeassistant/components/asuswrt/__init__.py @@ -1,9 +1,4 @@ -""" -Support for ASUSWRT devices. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/asuswrt/ -""" +"""Support for ASUSWRT devices.""" import logging import voluptuous as vol @@ -18,15 +13,16 @@ REQUIREMENTS = ['aioasuswrt==1.1.20'] _LOGGER = logging.getLogger(__name__) +CONF_PUB_KEY = 'pub_key' +CONF_REQUIRE_IP = 'require_ip' +CONF_SENSORS = 'sensors' +CONF_SSH_KEY = 'ssh_key' + DOMAIN = "asuswrt" DATA_ASUSWRT = DOMAIN - -CONF_PUB_KEY = 'pub_key' -CONF_SSH_KEY = 'ssh_key' -CONF_REQUIRE_IP = 'require_ip' DEFAULT_SSH_PORT = 22 + SECRET_GROUP = 'Password or SSH Key' -CONF_SENSORS = 'sensors' SENSOR_TYPES = ['upload_speed', 'download_speed', 'download', 'upload'] CONFIG_SCHEMA = vol.Schema({ diff --git a/homeassistant/components/august/__init__.py b/homeassistant/components/august/__init__.py index 2073f680e00..8e749dca46e 100644 --- a/homeassistant/components/august/__init__.py +++ b/homeassistant/components/august/__init__.py @@ -1,9 +1,4 @@ -""" -Support for August devices. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/august/ -""" +"""Support for August devices.""" import logging from datetime import timedelta diff --git a/homeassistant/components/august/binary_sensor.py b/homeassistant/components/august/binary_sensor.py index c059f4c020a..1ad2d80cea8 100644 --- a/homeassistant/components/august/binary_sensor.py +++ b/homeassistant/components/august/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for August binary sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.august/ -""" +"""Support for August binary sensors.""" import logging from datetime import timedelta, datetime diff --git a/homeassistant/components/august/camera.py b/homeassistant/components/august/camera.py index c62a32342dc..7420bb04067 100644 --- a/homeassistant/components/august/camera.py +++ b/homeassistant/components/august/camera.py @@ -1,9 +1,4 @@ -""" -Support for August camera. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/camera.august/ -""" +"""Support for August camera.""" from datetime import timedelta import requests diff --git a/homeassistant/components/august/lock.py b/homeassistant/components/august/lock.py index e8364170980..ff355bbf87b 100644 --- a/homeassistant/components/august/lock.py +++ b/homeassistant/components/august/lock.py @@ -1,9 +1,4 @@ -""" -Support for August lock. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/lock.august/ -""" +"""Support for August lock.""" import logging from datetime import timedelta diff --git a/homeassistant/components/automation/__init__.py b/homeassistant/components/automation/__init__.py index 836901cde30..35cf695f1e3 100644 --- a/homeassistant/components/automation/__init__.py +++ b/homeassistant/components/automation/__init__.py @@ -1,9 +1,4 @@ -""" -Allow to set up simple automation rules via the config file. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/automation/ -""" +"""Allow to set up simple automation rules via the config file.""" import asyncio from functools import partial import importlib diff --git a/homeassistant/components/automation/event.py b/homeassistant/components/automation/event.py index ec47479eac8..6cc7e3dae7d 100644 --- a/homeassistant/components/automation/event.py +++ b/homeassistant/components/automation/event.py @@ -1,9 +1,4 @@ -""" -Offer event listening automation rules. - -For more details about this automation rule, please refer to the documentation -at https://home-assistant.io/docs/automation/trigger/#event-trigger -""" +"""Offer event listening automation rules.""" import logging import voluptuous as vol diff --git a/homeassistant/components/automation/geo_location.py b/homeassistant/components/automation/geo_location.py index 33ef00da380..8f838ea6d6b 100644 --- a/homeassistant/components/automation/geo_location.py +++ b/homeassistant/components/automation/geo_location.py @@ -1,10 +1,4 @@ -""" -Offer geolocation automation rules. - -For more details about this automation trigger, please refer to the -documentation at -https://home-assistant.io/docs/automation/trigger/#geolocation-trigger -""" +"""Offer geolocation automation rules.""" import voluptuous as vol from homeassistant.components.geo_location import DOMAIN diff --git a/homeassistant/components/automation/homeassistant.py b/homeassistant/components/automation/homeassistant.py index 6d7a44291c9..1b022316676 100644 --- a/homeassistant/components/automation/homeassistant.py +++ b/homeassistant/components/automation/homeassistant.py @@ -1,9 +1,4 @@ -""" -Offer Home Assistant core automation rules. - -For more details about this automation rule, please refer to the documentation -at https://home-assistant.io/components/automation/#homeassistant-trigger -""" +"""Offer Home Assistant core automation rules.""" import logging import voluptuous as vol diff --git a/homeassistant/components/automation/litejet.py b/homeassistant/components/automation/litejet.py index 70e01174078..20c689d74cf 100644 --- a/homeassistant/components/automation/litejet.py +++ b/homeassistant/components/automation/litejet.py @@ -1,9 +1,4 @@ -""" -Trigger an automation when a LiteJet switch is released. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/automation.litejet/ -""" +"""Trigger an automation when a LiteJet switch is released.""" import logging import voluptuous as vol diff --git a/homeassistant/components/automation/mqtt.py b/homeassistant/components/automation/mqtt.py index 1fa0d540610..5f52da745ee 100644 --- a/homeassistant/components/automation/mqtt.py +++ b/homeassistant/components/automation/mqtt.py @@ -1,9 +1,4 @@ -""" -Offer MQTT listening automation rules. - -For more details about this automation rule, please refer to the documentation -at https://home-assistant.io/docs/automation/trigger/#mqtt-trigger -""" +"""Offer MQTT listening automation rules.""" import json import voluptuous as vol diff --git a/homeassistant/components/automation/numeric_state.py b/homeassistant/components/automation/numeric_state.py index aa51e631026..bf45abb88f0 100644 --- a/homeassistant/components/automation/numeric_state.py +++ b/homeassistant/components/automation/numeric_state.py @@ -1,9 +1,4 @@ -""" -Offer numeric state listening automation rules. - -For more details about this automation rule, please refer to the documentation -at https://home-assistant.io/docs/automation/trigger/#numeric-state-trigger -""" +"""Offer numeric state listening automation rules.""" import logging import voluptuous as vol diff --git a/homeassistant/components/automation/state.py b/homeassistant/components/automation/state.py index 4e47026d8d1..f4d7f69c07a 100644 --- a/homeassistant/components/automation/state.py +++ b/homeassistant/components/automation/state.py @@ -1,9 +1,4 @@ -""" -Offer state listening automation rules. - -For more details about this automation rule, please refer to the documentation -at https://home-assistant.io/docs/automation/trigger/#state-trigger -""" +"""Offer state listening automation rules.""" import voluptuous as vol from homeassistant.core import callback diff --git a/homeassistant/components/automation/sun.py b/homeassistant/components/automation/sun.py index 509195689a1..07fbf716e1c 100644 --- a/homeassistant/components/automation/sun.py +++ b/homeassistant/components/automation/sun.py @@ -1,9 +1,4 @@ -""" -Offer sun based automation rules. - -For more details about this automation rule, please refer to the documentation -at https://home-assistant.io/docs/automation/trigger/#sun-trigger -""" +"""Offer sun based automation rules.""" from datetime import timedelta import logging diff --git a/homeassistant/components/automation/template.py b/homeassistant/components/automation/template.py index 347b3f94e7d..ed86d52584f 100644 --- a/homeassistant/components/automation/template.py +++ b/homeassistant/components/automation/template.py @@ -1,9 +1,4 @@ -""" -Offer template automation rules. - -For more details about this automation rule, please refer to the documentation -at https://home-assistant.io/docs/automation/trigger/#template-trigger -""" +"""Offer template automation rules.""" import logging import voluptuous as vol @@ -13,7 +8,6 @@ from homeassistant.const import CONF_VALUE_TEMPLATE, CONF_PLATFORM from homeassistant.helpers.event import async_track_template import homeassistant.helpers.config_validation as cv - _LOGGER = logging.getLogger(__name__) TRIGGER_SCHEMA = IF_ACTION_SCHEMA = vol.Schema({ diff --git a/homeassistant/components/automation/time.py b/homeassistant/components/automation/time.py index d57e190490f..ce6d6eb4446 100644 --- a/homeassistant/components/automation/time.py +++ b/homeassistant/components/automation/time.py @@ -1,9 +1,4 @@ -""" -Offer time listening automation rules. - -For more details about this automation rule, please refer to the documentation -at https://home-assistant.io/docs/automation/trigger/#time-trigger -""" +"""Offer time listening automation rules.""" import logging import voluptuous as vol diff --git a/homeassistant/components/automation/time_pattern.py b/homeassistant/components/automation/time_pattern.py index 8b6e907f7b8..da8bc9f8629 100644 --- a/homeassistant/components/automation/time_pattern.py +++ b/homeassistant/components/automation/time_pattern.py @@ -1,9 +1,4 @@ -""" -Offer time listening automation rules. - -For more details about this automation rule, please refer to the documentation -at https://home-assistant.io/docs/automation/trigger/#time-trigger -""" +"""Offer time listening automation rules.""" import logging import voluptuous as vol diff --git a/homeassistant/components/automation/webhook.py b/homeassistant/components/automation/webhook.py index f4afc8a601a..f65b5cf885c 100644 --- a/homeassistant/components/automation/webhook.py +++ b/homeassistant/components/automation/webhook.py @@ -1,9 +1,4 @@ -""" -Offer webhook triggered automation rules. - -For more details about this automation rule, please refer to the documentation -at https://home-assistant.io/docs/automation/trigger/#webhook-trigger -""" +"""Offer webhook triggered automation rules.""" from functools import partial import logging diff --git a/homeassistant/components/automation/zone.py b/homeassistant/components/automation/zone.py index 0c3c0941a9e..e2d79eede8d 100644 --- a/homeassistant/components/automation/zone.py +++ b/homeassistant/components/automation/zone.py @@ -1,9 +1,4 @@ -""" -Offer zone automation rules. - -For more details about this automation rule, please refer to the documentation -at https://home-assistant.io/docs/automation/trigger/#zone-trigger -""" +"""Offer zone automation rules.""" import voluptuous as vol from homeassistant.core import callback diff --git a/homeassistant/components/axis/__init__.py b/homeassistant/components/axis/__init__.py index fd2e603445c..df723272a7a 100644 --- a/homeassistant/components/axis/__init__.py +++ b/homeassistant/components/axis/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Axis devices. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/axis/ -""" +"""Support for Axis devices.""" import logging import voluptuous as vol diff --git a/homeassistant/components/axis/binary_sensor.py b/homeassistant/components/axis/binary_sensor.py index 671bbc730d0..11014dc4bc9 100644 --- a/homeassistant/components/axis/binary_sensor.py +++ b/homeassistant/components/axis/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for Axis binary sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.axis/ -""" +"""Support for Axis binary sensors.""" from datetime import timedelta import logging diff --git a/homeassistant/components/axis/camera.py b/homeassistant/components/axis/camera.py index 9846ae85fb2..b9e969efec1 100644 --- a/homeassistant/components/axis/camera.py +++ b/homeassistant/components/axis/camera.py @@ -1,9 +1,4 @@ -""" -Support for Axis camera streaming. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/camera.axis/ -""" +"""Support for Axis camera streaming.""" import logging from homeassistant.components.camera.mjpeg import ( diff --git a/homeassistant/components/bbb_gpio/__init__.py b/homeassistant/components/bbb_gpio/__init__.py index e3f327f1d5c..7749af8f335 100644 --- a/homeassistant/components/bbb_gpio/__init__.py +++ b/homeassistant/components/bbb_gpio/__init__.py @@ -1,9 +1,4 @@ -""" -Support for controlling GPIO pins of a Beaglebone Black. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/bbb_gpio/ -""" +"""Support for controlling GPIO pins of a Beaglebone Black.""" import logging from homeassistant.const import ( diff --git a/homeassistant/components/bbb_gpio/binary_sensor.py b/homeassistant/components/bbb_gpio/binary_sensor.py index 8968b680369..1ee371dcc2a 100644 --- a/homeassistant/components/bbb_gpio/binary_sensor.py +++ b/homeassistant/components/bbb_gpio/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for binary sensor using Beaglebone Black GPIO. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.bbb_gpio/ -""" +"""Support for binary sensor using Beaglebone Black GPIO.""" import logging import voluptuous as vol diff --git a/homeassistant/components/bbb_gpio/switch.py b/homeassistant/components/bbb_gpio/switch.py index 9e120beb442..3ad46fd61ae 100644 --- a/homeassistant/components/bbb_gpio/switch.py +++ b/homeassistant/components/bbb_gpio/switch.py @@ -1,9 +1,4 @@ -""" -Allows to configure a switch using BeagleBone Black GPIO. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/switch.bbb_gpio/ -""" +"""Allows to configure a switch using BeagleBone Black GPIO.""" import logging import voluptuous as vol @@ -29,8 +24,7 @@ PIN_SCHEMA = vol.Schema({ }) PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ - vol.Required(CONF_PINS, default={}): - vol.Schema({cv.string: PIN_SCHEMA}), + vol.Required(CONF_PINS, default={}): vol.Schema({cv.string: PIN_SCHEMA}), }) diff --git a/homeassistant/components/blink/__init__.py b/homeassistant/components/blink/__init__.py index bcf95ee2055..8e95f967396 100644 --- a/homeassistant/components/blink/__init__.py +++ b/homeassistant/components/blink/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Blink Home Camera System. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/blink/ -""" +"""Support for Blink Home Camera System.""" import logging from datetime import timedelta import voluptuous as vol diff --git a/homeassistant/components/blink/alarm_control_panel.py b/homeassistant/components/blink/alarm_control_panel.py index 77267fd7516..b9bf4a5250f 100644 --- a/homeassistant/components/blink/alarm_control_panel.py +++ b/homeassistant/components/blink/alarm_control_panel.py @@ -1,9 +1,4 @@ -""" -Support for Blink Alarm Control Panel. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/alarm_control_panel.blink/ -""" +"""Support for Blink Alarm Control Panel.""" import logging from homeassistant.components.alarm_control_panel import AlarmControlPanel diff --git a/homeassistant/components/blink/binary_sensor.py b/homeassistant/components/blink/binary_sensor.py index cd558f03684..fe0b95b1517 100644 --- a/homeassistant/components/blink/binary_sensor.py +++ b/homeassistant/components/blink/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for Blink system camera control. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.blink. -""" +"""Support for Blink system camera control.""" from homeassistant.components.blink import BLINK_DATA, BINARY_SENSORS from homeassistant.components.binary_sensor import BinarySensorDevice from homeassistant.const import CONF_MONITORED_CONDITIONS diff --git a/homeassistant/components/blink/camera.py b/homeassistant/components/blink/camera.py index e9047914456..2e5c024d6e5 100644 --- a/homeassistant/components/blink/camera.py +++ b/homeassistant/components/blink/camera.py @@ -1,9 +1,4 @@ -""" -Support for Blink system camera. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/camera.blink/ -""" +"""Support for Blink system camera.""" import logging from homeassistant.components.blink import BLINK_DATA, DEFAULT_BRAND diff --git a/homeassistant/components/blink/sensor.py b/homeassistant/components/blink/sensor.py index a1a07cb2a73..c1fdf9252dd 100644 --- a/homeassistant/components/blink/sensor.py +++ b/homeassistant/components/blink/sensor.py @@ -1,9 +1,4 @@ -""" -Support for Blink system camera sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.blink/ -""" +"""Support for Blink system camera sensors.""" import logging from homeassistant.components.blink import BLINK_DATA, SENSORS diff --git a/homeassistant/components/bloomsky/__init__.py b/homeassistant/components/bloomsky/__init__.py index 55fb15c686d..a42eb34004b 100644 --- a/homeassistant/components/bloomsky/__init__.py +++ b/homeassistant/components/bloomsky/__init__.py @@ -1,9 +1,4 @@ -""" -Support for BloomSky weather station. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/bloomsky/ -""" +"""Support for BloomSky weather station.""" from datetime import timedelta import logging diff --git a/homeassistant/components/bloomsky/binary_sensor.py b/homeassistant/components/bloomsky/binary_sensor.py index 971941f4dd6..c8763524de7 100644 --- a/homeassistant/components/bloomsky/binary_sensor.py +++ b/homeassistant/components/bloomsky/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support the binary sensors of a BloomSky weather station. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.bloomsky/ -""" +"""Support the binary sensors of a BloomSky weather station.""" import logging import voluptuous as vol diff --git a/homeassistant/components/bloomsky/camera.py b/homeassistant/components/bloomsky/camera.py index 1c9266ca3a7..5cb2e1adfe1 100644 --- a/homeassistant/components/bloomsky/camera.py +++ b/homeassistant/components/bloomsky/camera.py @@ -1,9 +1,4 @@ -""" -Support for a camera of a BloomSky weather station. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/camera.bloomsky/ -""" +"""Support for a camera of a BloomSky weather station.""" import logging import requests diff --git a/homeassistant/components/bloomsky/sensor.py b/homeassistant/components/bloomsky/sensor.py index 02cd456107f..7e6847f0e7e 100644 --- a/homeassistant/components/bloomsky/sensor.py +++ b/homeassistant/components/bloomsky/sensor.py @@ -1,9 +1,4 @@ -""" -Support the sensor of a BloomSky weather station. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/sensor.bloomsky/ -""" +"""Support the sensor of a BloomSky weather station.""" import logging import voluptuous as vol diff --git a/homeassistant/components/bmw_connected_drive/__init__.py b/homeassistant/components/bmw_connected_drive/__init__.py index 40f2b91045a..e1ac30120d2 100644 --- a/homeassistant/components/bmw_connected_drive/__init__.py +++ b/homeassistant/components/bmw_connected_drive/__init__.py @@ -1,9 +1,4 @@ -""" -Reads vehicle status from BMW connected drive portal. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/bmw_connected_drive/ -""" +"""Reads vehicle status from BMW connected drive portal.""" import datetime import logging @@ -87,8 +82,8 @@ def setup_account(account_config: dict, hass, name: str) \ read_only = account_config[CONF_READ_ONLY] _LOGGER.debug('Adding new account %s', name) - cd_account = BMWConnectedDriveAccount(username, password, region, name, - read_only) + cd_account = BMWConnectedDriveAccount( + username, password, region, name, read_only) def execute_service(call): """Execute a service for a vehicle. @@ -99,7 +94,7 @@ def setup_account(account_config: dict, hass, name: str) \ vin = call.data[ATTR_VIN] vehicle = cd_account.account.get_vehicle(vin) if not vehicle: - _LOGGER.error('Could not find a vehicle for VIN "%s"!', vin) + _LOGGER.error("Could not find a vehicle for VIN %s", vin) return function_name = _SERVICE_MAP[call.service] function_call = getattr(vehicle.remote_services, function_name) @@ -108,9 +103,7 @@ def setup_account(account_config: dict, hass, name: str) \ # register the remote services for service in _SERVICE_MAP: hass.services.register( - DOMAIN, service, - execute_service, - schema=SERVICE_SCHEMA) + DOMAIN, service, execute_service, schema=SERVICE_SCHEMA) # update every UPDATE_INTERVAL minutes, starting now # this should even out the load on the servers @@ -144,15 +137,15 @@ class BMWConnectedDriveAccount: Notify all listeners about the update. """ - _LOGGER.debug('Updating vehicle state for account %s, ' - 'notifying %d listeners', - self.name, len(self._update_listeners)) + _LOGGER.debug( + "Updating vehicle state for account %s, notifying %d listeners", + self.name, len(self._update_listeners)) try: self.account.update_vehicle_states() for listener in self._update_listeners: listener() except IOError as exception: - _LOGGER.error('Error updating the vehicle state.') + _LOGGER.error("Error updating the vehicle state") _LOGGER.exception(exception) def add_update_listener(self, listener): diff --git a/homeassistant/components/bmw_connected_drive/binary_sensor.py b/homeassistant/components/bmw_connected_drive/binary_sensor.py index f8855b2e28b..1843f647df8 100644 --- a/homeassistant/components/bmw_connected_drive/binary_sensor.py +++ b/homeassistant/components/bmw_connected_drive/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Reads vehicle status from BMW connected drive portal. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.bmw_connected_drive/ -""" +"""Reads vehicle status from BMW connected drive portal.""" import logging from homeassistant.components.binary_sensor import BinarySensorDevice @@ -42,14 +37,14 @@ def setup_platform(hass, config, add_entities, discovery_info=None): if vehicle.has_hv_battery: _LOGGER.debug('BMW with a high voltage battery') for key, value in sorted(SENSOR_TYPES_ELEC.items()): - device = BMWConnectedDriveSensor(account, vehicle, key, - value[0], value[1]) + device = BMWConnectedDriveSensor( + account, vehicle, key, value[0], value[1]) devices.append(device) elif vehicle.has_internal_combustion_engine: _LOGGER.debug('BMW with an internal combustion engine') for key, value in sorted(SENSOR_TYPES.items()): - device = BMWConnectedDriveSensor(account, vehicle, key, - value[0], value[1]) + device = BMWConnectedDriveSensor( + account, vehicle, key, value[0], value[1]) devices.append(device) add_entities(devices, True) diff --git a/homeassistant/components/bmw_connected_drive/device_tracker.py b/homeassistant/components/bmw_connected_drive/device_tracker.py index 02a12653180..21121b069af 100644 --- a/homeassistant/components/bmw_connected_drive/device_tracker.py +++ b/homeassistant/components/bmw_connected_drive/device_tracker.py @@ -1,8 +1,4 @@ -"""Device tracker for BMW Connected Drive vehicles. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/device_tracker.bmw_connected_drive/ -""" +"""Device tracker for BMW Connected Drive vehicles.""" import logging from homeassistant.components.bmw_connected_drive import DOMAIN \ diff --git a/homeassistant/components/bmw_connected_drive/lock.py b/homeassistant/components/bmw_connected_drive/lock.py index b13665610d8..8a5eddaa86a 100644 --- a/homeassistant/components/bmw_connected_drive/lock.py +++ b/homeassistant/components/bmw_connected_drive/lock.py @@ -1,9 +1,4 @@ -""" -Support for BMW cars with BMW ConnectedDrive. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/lock.bmw_connected_drive/ -""" +"""Support for BMW car locks with BMW ConnectedDrive.""" import logging from homeassistant.components.bmw_connected_drive import DOMAIN as BMW_DOMAIN diff --git a/homeassistant/components/bmw_connected_drive/sensor.py b/homeassistant/components/bmw_connected_drive/sensor.py index a7ee5724d19..a01142c53ed 100644 --- a/homeassistant/components/bmw_connected_drive/sensor.py +++ b/homeassistant/components/bmw_connected_drive/sensor.py @@ -1,9 +1,4 @@ -""" -Reads vehicle status from BMW connected drive portal. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.bmw_connected_drive/ -""" +"""Support for reading vehicle status from BMW connected drive portal.""" import logging from homeassistant.components.bmw_connected_drive import DOMAIN as BMW_DOMAIN @@ -25,7 +20,7 @@ ATTR_TO_HA_METRIC = { 'max_range_electric': ['mdi:ruler', LENGTH_KILOMETERS], 'remaining_fuel': ['mdi:gas-station', VOLUME_LITERS], 'charging_time_remaining': ['mdi:update', 'h'], - 'charging_status': ['mdi:battery-charging', None] + 'charging_status': ['mdi:battery-charging', None], } ATTR_TO_HA_IMPERIAL = { @@ -36,7 +31,7 @@ ATTR_TO_HA_IMPERIAL = { 'max_range_electric': ['mdi:ruler', LENGTH_MILES], 'remaining_fuel': ['mdi:gas-station', VOLUME_GALLONS], 'charging_time_remaining': ['mdi:update', 'h'], - 'charging_status': ['mdi:battery-charging', None] + 'charging_status': ['mdi:battery-charging', None], } @@ -54,12 +49,11 @@ def setup_platform(hass, config, add_entities, discovery_info=None): for account in accounts: for vehicle in account.account.vehicles: for attribute_name in vehicle.drive_train_attributes: - device = BMWConnectedDriveSensor(account, vehicle, - attribute_name, - attribute_info) + device = BMWConnectedDriveSensor( + account, vehicle, attribute_name, attribute_info) devices.append(device) - device = BMWConnectedDriveSensor(account, vehicle, 'mileage', - attribute_info) + device = BMWConnectedDriveSensor( + account, vehicle, 'mileage', attribute_info) devices.append(device) add_entities(devices, True) @@ -140,13 +134,13 @@ class BMWConnectedDriveSensor(Entity): self._state = getattr(vehicle_state, self._attribute).value elif self.unit_of_measurement == VOLUME_GALLONS: value = getattr(vehicle_state, self._attribute) - value_converted = self.hass.config.units.volume(value, - VOLUME_LITERS) + value_converted = self.hass.config.units.volume( + value, VOLUME_LITERS) self._state = round(value_converted) elif self.unit_of_measurement == LENGTH_MILES: value = getattr(vehicle_state, self._attribute) - value_converted = self.hass.config.units.length(value, - LENGTH_KILOMETERS) + value_converted = self.hass.config.units.length( + value, LENGTH_KILOMETERS) self._state = round(value_converted) else: self._state = getattr(vehicle_state, self._attribute) diff --git a/homeassistant/components/browser/__init__.py b/homeassistant/components/browser/__init__.py index 041a0f9cdc6..1c002f21f5f 100644 --- a/homeassistant/components/browser/__init__.py +++ b/homeassistant/components/browser/__init__.py @@ -1,17 +1,13 @@ -""" -Provides functionality to launch a web browser on the host machine. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/browser/ -""" +"""Support for launching a web browser on the host machine.""" import voluptuous as vol -DOMAIN = "browser" -SERVICE_BROWSE_URL = "browse_url" - ATTR_URL = 'url' ATTR_URL_DEFAULT = 'https://www.google.com' +DOMAIN = 'browser' + +SERVICE_BROWSE_URL = 'browse_url' + SERVICE_BROWSE_URL_SCHEMA = vol.Schema({ # pylint: disable=no-value-for-parameter vol.Required(ATTR_URL, default=ATTR_URL_DEFAULT): vol.Url(), diff --git a/homeassistant/components/calendar/__init__.py b/homeassistant/components/calendar/__init__.py index 024dc1ac9de..aa9e3153fe5 100644 --- a/homeassistant/components/calendar/__init__.py +++ b/homeassistant/components/calendar/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Google Calendar event device sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/calendar/ -""" +"""Support for Google Calendar event device sensors.""" import logging from datetime import timedelta import re diff --git a/homeassistant/components/canary/__init__.py b/homeassistant/components/canary/__init__.py index 04c33d83f3d..e53c7e22d2d 100644 --- a/homeassistant/components/canary/__init__.py +++ b/homeassistant/components/canary/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Canary. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/canary/ -""" +"""Support for Canary devices.""" import logging from datetime import timedelta diff --git a/homeassistant/components/cast/__init__.py b/homeassistant/components/cast/__init__.py index bc2f52139e2..94b926795e7 100644 --- a/homeassistant/components/cast/__init__.py +++ b/homeassistant/components/cast/__init__.py @@ -2,9 +2,9 @@ from homeassistant import config_entries from homeassistant.helpers import config_entry_flow +REQUIREMENTS = ['pychromecast==2.5.0'] DOMAIN = 'cast' -REQUIREMENTS = ['pychromecast==2.5.0'] async def async_setup(hass, config): diff --git a/homeassistant/components/cast/media_player.py b/homeassistant/components/cast/media_player.py index a58bab92e9d..432290482f1 100644 --- a/homeassistant/components/cast/media_player.py +++ b/homeassistant/components/cast/media_player.py @@ -1,9 +1,4 @@ -""" -Provide functionality to interact with Cast devices on the network. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/media_player.cast/ -""" +"""Provide functionality to interact with Cast devices on the network.""" import asyncio import logging import threading diff --git a/homeassistant/components/cloud/__init__.py b/homeassistant/components/cloud/__init__.py index 98e649e1742..c427657c76d 100644 --- a/homeassistant/components/cloud/__init__.py +++ b/homeassistant/components/cloud/__init__.py @@ -1,9 +1,4 @@ -""" -Component to integrate the Home Assistant cloud. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/cloud/ -""" +"""Component to integrate the Home Assistant cloud.""" from datetime import datetime, timedelta import json import logging diff --git a/homeassistant/components/cloudflare/__init__.py b/homeassistant/components/cloudflare/__init__.py index ae400ca6385..363e7c5eeb1 100644 --- a/homeassistant/components/cloudflare/__init__.py +++ b/homeassistant/components/cloudflare/__init__.py @@ -1,9 +1,4 @@ -""" -Update the IP addresses of your Cloudflare DNS records. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/cloudflare/ -""" +"""Update the IP addresses of your Cloudflare DNS records.""" from datetime import timedelta import logging diff --git a/homeassistant/components/coinbase/__init__.py b/homeassistant/components/coinbase/__init__.py index 98c321b9f5a..40d04eadb3a 100644 --- a/homeassistant/components/coinbase/__init__.py +++ b/homeassistant/components/coinbase/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Coinbase. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/coinbase/ -""" +"""Support for Coinbase.""" from datetime import timedelta import logging diff --git a/homeassistant/components/comfoconnect/__init__.py b/homeassistant/components/comfoconnect/__init__.py index 69d88274f29..64ebec18545 100644 --- a/homeassistant/components/comfoconnect/__init__.py +++ b/homeassistant/components/comfoconnect/__init__.py @@ -1,9 +1,4 @@ -""" -Support to control a Zehnder ComfoAir Q350/450/600 ventilation unit. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/comfoconnect/ -""" +"""Support to control a Zehnder ComfoAir Q350/450/600 ventilation unit.""" import logging import voluptuous as vol diff --git a/homeassistant/components/comfoconnect/fan.py b/homeassistant/components/comfoconnect/fan.py index 0e0ac8c80b6..a396dd276a5 100644 --- a/homeassistant/components/comfoconnect/fan.py +++ b/homeassistant/components/comfoconnect/fan.py @@ -1,9 +1,4 @@ -""" -Platform to control a Zehnder ComfoAir Q350/450/600 ventilation unit. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/fan.comfoconnect/ -""" +"""Platform to control a Zehnder ComfoAir Q350/450/600 ventilation unit.""" import logging from homeassistant.components.comfoconnect import ( diff --git a/homeassistant/components/comfoconnect/sensor.py b/homeassistant/components/comfoconnect/sensor.py index 9ae6a4de091..ac5de866cfb 100644 --- a/homeassistant/components/comfoconnect/sensor.py +++ b/homeassistant/components/comfoconnect/sensor.py @@ -1,9 +1,4 @@ -""" -Platform to control a Zehnder ComfoAir Q350/450/600 ventilation unit. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/sensor.comfoconnect/ -""" +"""Platform to control a Zehnder ComfoAir Q350/450/600 ventilation unit.""" import logging from homeassistant.components.comfoconnect import ( diff --git a/homeassistant/components/config/automation.py b/homeassistant/components/config/automation.py index 7836cba6cf9..47ac9d3a4b2 100644 --- a/homeassistant/components/config/automation.py +++ b/homeassistant/components/config/automation.py @@ -7,7 +7,6 @@ from homeassistant.const import CONF_ID, SERVICE_RELOAD from homeassistant.components.automation import DOMAIN, PLATFORM_SCHEMA import homeassistant.helpers.config_validation as cv - CONFIG_PATH = 'automations.yaml' diff --git a/homeassistant/components/config/customize.py b/homeassistant/components/config/customize.py index b7a8c9c070a..ec9d9d0ff27 100644 --- a/homeassistant/components/config/customize.py +++ b/homeassistant/components/config/customize.py @@ -1,5 +1,4 @@ """Provide configuration end points for Customize.""" - from homeassistant.components.config import EditKeyBasedConfigView from homeassistant.components import SERVICE_RELOAD_CORE_CONFIG from homeassistant.config import DATA_CUSTOMIZE diff --git a/homeassistant/components/config/script.py b/homeassistant/components/config/script.py index 3adc6f14233..640e267d066 100644 --- a/homeassistant/components/config/script.py +++ b/homeassistant/components/config/script.py @@ -1,5 +1,4 @@ """Provide configuration end points for scripts.""" - from homeassistant.components.config import EditKeyBasedConfigView from homeassistant.components.script import DOMAIN, SCRIPT_ENTRY_SCHEMA from homeassistant.const import SERVICE_RELOAD diff --git a/homeassistant/components/config/zwave.py b/homeassistant/components/config/zwave.py index 57123ee12de..f29dde4594c 100644 --- a/homeassistant/components/config/zwave.py +++ b/homeassistant/components/config/zwave.py @@ -1,13 +1,14 @@ """Provide configuration end points for Z-Wave.""" +from collections import deque import logging -from collections import deque from aiohttp.web import Response -import homeassistant.core as ha -from homeassistant.const import HTTP_NOT_FOUND, HTTP_OK -from homeassistant.components.http import HomeAssistantView + from homeassistant.components.config import EditKeyBasedConfigView -from homeassistant.components.zwave import const, DEVICE_CONFIG_SCHEMA_ENTRY +from homeassistant.components.http import HomeAssistantView +from homeassistant.components.zwave import DEVICE_CONFIG_SCHEMA_ENTRY, const +from homeassistant.const import HTTP_NOT_FOUND, HTTP_OK +import homeassistant.core as ha import homeassistant.helpers.config_validation as cv _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/conversation/__init__.py b/homeassistant/components/conversation/__init__.py index d8d386f5ca0..7082cb36726 100644 --- a/homeassistant/components/conversation/__init__.py +++ b/homeassistant/components/conversation/__init__.py @@ -1,9 +1,4 @@ -""" -Support for functionality to have conversations with Home Assistant. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/conversation/ -""" +"""Support for functionality to have conversations with Home Assistant.""" import logging import re diff --git a/homeassistant/components/counter/__init__.py b/homeassistant/components/counter/__init__.py index aeef2818f63..ab7ada618fe 100644 --- a/homeassistant/components/counter/__init__.py +++ b/homeassistant/components/counter/__init__.py @@ -1,9 +1,4 @@ -""" -Component to count within automations. - -For more details about this component, please refer to the documentation -at https://home-assistant.io/components/counter/ -""" +"""Component to count within automations.""" import logging import voluptuous as vol diff --git a/homeassistant/components/daikin/__init__.py b/homeassistant/components/daikin/__init__.py index f16d6a87d55..ce4a58162c7 100644 --- a/homeassistant/components/daikin/__init__.py +++ b/homeassistant/components/daikin/__init__.py @@ -1,9 +1,4 @@ -""" -Platform for the Daikin AC. - -For more details about this component, please refer to the documentation -https://home-assistant.io/components/daikin/ -""" +"""Platform for the Daikin AC.""" import asyncio from datetime import timedelta import logging diff --git a/homeassistant/components/daikin/climate.py b/homeassistant/components/daikin/climate.py index 45589c12864..d97b506e273 100644 --- a/homeassistant/components/daikin/climate.py +++ b/homeassistant/components/daikin/climate.py @@ -1,9 +1,4 @@ -""" -Support for the Daikin HVAC. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/climate.daikin/ -""" +"""Support for the Daikin HVAC.""" import logging import re @@ -22,7 +17,6 @@ from homeassistant.const import ( ATTR_TEMPERATURE, CONF_HOST, CONF_NAME, TEMP_CELSIUS) import homeassistant.helpers.config_validation as cv - _LOGGER = logging.getLogger(__name__) PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ diff --git a/homeassistant/components/daikin/sensor.py b/homeassistant/components/daikin/sensor.py index f887ccf64a0..6065a182274 100644 --- a/homeassistant/components/daikin/sensor.py +++ b/homeassistant/components/daikin/sensor.py @@ -1,9 +1,4 @@ -""" -Support for Daikin AC Sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.daikin/ -""" +"""Support for Daikin AC sensors.""" import logging from homeassistant.components.daikin import DOMAIN as DAIKIN_DOMAIN diff --git a/homeassistant/components/danfoss_air/__init__.py b/homeassistant/components/danfoss_air/__init__.py index 80c36b6f0c6..d6123a25f23 100644 --- a/homeassistant/components/danfoss_air/__init__.py +++ b/homeassistant/components/danfoss_air/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Danfoss Air HRV. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/danfoss_air/ -""" +"""Support for Danfoss Air HRV.""" from datetime import timedelta import logging diff --git a/homeassistant/components/datadog/__init__.py b/homeassistant/components/datadog/__init__.py index 58503d7187b..3b519514d17 100644 --- a/homeassistant/components/datadog/__init__.py +++ b/homeassistant/components/datadog/__init__.py @@ -1,9 +1,4 @@ -""" -A component which allows you to send data to Datadog. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/datadog/ -""" +"""Support for sending data to Datadog.""" import logging import voluptuous as vol diff --git a/homeassistant/components/deconz/__init__.py b/homeassistant/components/deconz/__init__.py index 4d3e2cbc6a9..8015324be13 100644 --- a/homeassistant/components/deconz/__init__.py +++ b/homeassistant/components/deconz/__init__.py @@ -1,9 +1,4 @@ -""" -Support for deCONZ devices. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/deconz/ -""" +"""Support for deCONZ devices.""" import voluptuous as vol from homeassistant import config_entries diff --git a/homeassistant/components/deconz/binary_sensor.py b/homeassistant/components/deconz/binary_sensor.py index 286b310c1a9..77d01c5c40b 100644 --- a/homeassistant/components/deconz/binary_sensor.py +++ b/homeassistant/components/deconz/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for deCONZ binary sensor. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.deconz/ -""" +"""Support for deCONZ binary sensors.""" from homeassistant.components.binary_sensor import BinarySensorDevice from homeassistant.const import ATTR_BATTERY_LEVEL from homeassistant.core import callback @@ -16,8 +11,8 @@ from .deconz_device import DeconzDevice DEPENDENCIES = ['deconz'] -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Old way of setting up deCONZ binary sensors.""" pass diff --git a/homeassistant/components/deconz/config_flow.py b/homeassistant/components/deconz/config_flow.py index f7bc71a2398..8f90f303fca 100644 --- a/homeassistant/components/deconz/config_flow.py +++ b/homeassistant/components/deconz/config_flow.py @@ -1,5 +1,4 @@ """Config flow to configure deCONZ component.""" - import voluptuous as vol from homeassistant import config_entries diff --git a/homeassistant/components/deconz/cover.py b/homeassistant/components/deconz/cover.py index 99bdd20a295..48f06a894bb 100644 --- a/homeassistant/components/deconz/cover.py +++ b/homeassistant/components/deconz/cover.py @@ -1,9 +1,4 @@ -""" -Support for deCONZ covers. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/cover.deconz/ -""" +"""Support for deCONZ covers.""" from homeassistant.components.cover import ( ATTR_POSITION, CoverDevice, SUPPORT_CLOSE, SUPPORT_OPEN, SUPPORT_STOP, SUPPORT_SET_POSITION) @@ -18,8 +13,8 @@ DEPENDENCIES = ['deconz'] ZIGBEE_SPEC = ['lumi.curtain'] -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Unsupported way of setting up deCONZ covers.""" pass diff --git a/homeassistant/components/deconz/light.py b/homeassistant/components/deconz/light.py index f7c777b8100..50e22c84d6f 100644 --- a/homeassistant/components/deconz/light.py +++ b/homeassistant/components/deconz/light.py @@ -1,9 +1,4 @@ -""" -Support for deCONZ light. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/light.deconz/ -""" +"""Support for deCONZ lights.""" from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_EFFECT, ATTR_FLASH, ATTR_HS_COLOR, ATTR_TRANSITION, EFFECT_COLORLOOP, FLASH_LONG, FLASH_SHORT, @@ -21,8 +16,8 @@ from .deconz_device import DeconzDevice DEPENDENCIES = ['deconz'] -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Old way of setting up deCONZ lights and group.""" pass diff --git a/homeassistant/components/deconz/scene.py b/homeassistant/components/deconz/scene.py index 05845a02288..d3a6df810ba 100644 --- a/homeassistant/components/deconz/scene.py +++ b/homeassistant/components/deconz/scene.py @@ -1,9 +1,4 @@ -""" -Support for deCONZ scenes. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/scene.deconz/ -""" +"""Support for deCONZ scenes.""" from homeassistant.components.deconz import DOMAIN as DECONZ_DOMAIN from homeassistant.components.scene import Scene from homeassistant.core import callback @@ -12,8 +7,8 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect DEPENDENCIES = ['deconz'] -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Old way of setting up deCONZ scenes.""" pass diff --git a/homeassistant/components/deconz/sensor.py b/homeassistant/components/deconz/sensor.py index 1913e3d5087..3083f0c6732 100644 --- a/homeassistant/components/deconz/sensor.py +++ b/homeassistant/components/deconz/sensor.py @@ -1,9 +1,4 @@ -""" -Support for deCONZ sensor. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/sensor.deconz/ -""" +"""Support for deCONZ sensors.""" from homeassistant.const import ( ATTR_BATTERY_LEVEL, ATTR_VOLTAGE, DEVICE_CLASS_BATTERY) from homeassistant.core import callback @@ -21,8 +16,8 @@ ATTR_DAYLIGHT = 'daylight' ATTR_EVENT_ID = 'event_id' -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Old way of setting up deCONZ sensors.""" pass diff --git a/homeassistant/components/deconz/switch.py b/homeassistant/components/deconz/switch.py index 64d93389670..c48c7205e01 100644 --- a/homeassistant/components/deconz/switch.py +++ b/homeassistant/components/deconz/switch.py @@ -1,9 +1,4 @@ -""" -Support for deCONZ switches. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.deconz/ -""" +"""Support for deCONZ switches.""" from homeassistant.components.switch import SwitchDevice from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_connect @@ -11,12 +6,11 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect from .const import DOMAIN as DECONZ_DOMAIN, POWER_PLUGS, SIRENS from .deconz_device import DeconzDevice - DEPENDENCIES = ['deconz'] -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Old way of setting up deCONZ switches.""" pass diff --git a/homeassistant/components/demo/__init__.py b/homeassistant/components/demo/__init__.py index 2b9854fbcc7..2699ade0b1d 100644 --- a/homeassistant/components/demo/__init__.py +++ b/homeassistant/components/demo/__init__.py @@ -1,9 +1,4 @@ -""" -Set up the demo environment that mimics interaction with devices. - -For more details about this component, please refer to the documentation -https://home-assistant.io/components/demo/ -""" +"""Set up the demo environment that mimics interaction with devices.""" import asyncio import time diff --git a/homeassistant/components/dialogflow/__init__.py b/homeassistant/components/dialogflow/__init__.py index 3f3fbe7c14e..210aebe80d5 100644 --- a/homeassistant/components/dialogflow/__init__.py +++ b/homeassistant/components/dialogflow/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Dialogflow webhook. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/dialogflow/ -""" +"""Support for Dialogflow webhook.""" import logging import voluptuous as vol @@ -12,6 +7,7 @@ from aiohttp import web from homeassistant.const import CONF_WEBHOOK_ID from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers import intent, template, config_entry_flow + _LOGGER = logging.getLogger(__name__) DEPENDENCIES = ['webhook'] @@ -29,7 +25,7 @@ class DialogFlowError(HomeAssistantError): async def async_setup(hass, config): - """Set up Dialogflow component.""" + """Set up the Dialogflow component.""" return True @@ -45,9 +41,7 @@ async def handle_webhook(hass, webhook_id, request): except DialogFlowError as err: _LOGGER.warning(str(err)) - return web.json_response( - dialogflow_error_response(message, str(err)) - ) + return web.json_response(dialogflow_error_response(message, str(err))) except intent.UnknownIntent as err: _LOGGER.warning(str(err)) diff --git a/homeassistant/components/digital_ocean/__init__.py b/homeassistant/components/digital_ocean/__init__.py index c0c9d95586c..d061dad6726 100644 --- a/homeassistant/components/digital_ocean/__init__.py +++ b/homeassistant/components/digital_ocean/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Digital Ocean. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/digital_ocean/ -""" +"""Support for Digital Ocean.""" import logging from datetime import timedelta diff --git a/homeassistant/components/digital_ocean/binary_sensor.py b/homeassistant/components/digital_ocean/binary_sensor.py index 0f604c525e0..255f43b67ba 100644 --- a/homeassistant/components/digital_ocean/binary_sensor.py +++ b/homeassistant/components/digital_ocean/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for monitoring the state of Digital Ocean droplets. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.digital_ocean/ -""" +"""Support for monitoring the state of Digital Ocean droplets.""" import logging import voluptuous as vol diff --git a/homeassistant/components/digital_ocean/switch.py b/homeassistant/components/digital_ocean/switch.py index c17df81abba..a10c961b8e4 100644 --- a/homeassistant/components/digital_ocean/switch.py +++ b/homeassistant/components/digital_ocean/switch.py @@ -1,9 +1,4 @@ -""" -Support for interacting with Digital Ocean droplets. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/switch.digital_ocean/ -""" +"""Support for interacting with Digital Ocean droplets.""" import logging import voluptuous as vol diff --git a/homeassistant/components/discovery/__init__.py b/homeassistant/components/discovery/__init__.py index 87b89ddb44c..85e3164d08b 100644 --- a/homeassistant/components/discovery/__init__.py +++ b/homeassistant/components/discovery/__init__.py @@ -26,28 +26,28 @@ REQUIREMENTS = ['netdisco==2.3.0'] DOMAIN = 'discovery' SCAN_INTERVAL = timedelta(seconds=300) -SERVICE_NETGEAR = 'netgear_router' -SERVICE_WEMO = 'belkin_wemo' -SERVICE_HASS_IOS_APP = 'hass_ios' -SERVICE_IKEA_TRADFRI = 'ikea_tradfri' -SERVICE_HASSIO = 'hassio' -SERVICE_AXIS = 'axis' SERVICE_APPLE_TV = 'apple_tv' -SERVICE_WINK = 'wink' -SERVICE_XIAOMI_GW = 'xiaomi_gw' -SERVICE_TELLDUSLIVE = 'tellstick' -SERVICE_HUE = 'philips_hue' -SERVICE_KONNECTED = 'konnected' -SERVICE_DECONZ = 'deconz' +SERVICE_AXIS = 'axis' SERVICE_DAIKIN = 'daikin' +SERVICE_DECONZ = 'deconz' +SERVICE_DLNA_DMR = 'dlna_dmr' +SERVICE_FREEBOX = 'freebox' +SERVICE_HASS_IOS_APP = 'hass_ios' +SERVICE_HASSIO = 'hassio' +SERVICE_HOMEKIT = 'homekit' +SERVICE_HUE = 'philips_hue' +SERVICE_IGD = 'igd' +SERVICE_IKEA_TRADFRI = 'ikea_tradfri' +SERVICE_KONNECTED = 'konnected' +SERVICE_NETGEAR = 'netgear_router' +SERVICE_OCTOPRINT = 'octoprint' +SERVICE_ROKU = 'roku' SERVICE_SABNZBD = 'sabnzbd' SERVICE_SAMSUNG_PRINTER = 'samsung_printer' -SERVICE_HOMEKIT = 'homekit' -SERVICE_OCTOPRINT = 'octoprint' -SERVICE_FREEBOX = 'freebox' -SERVICE_IGD = 'igd' -SERVICE_DLNA_DMR = 'dlna_dmr' -SERVICE_ROKU = 'roku' +SERVICE_TELLDUSLIVE = 'tellstick' +SERVICE_WEMO = 'belkin_wemo' +SERVICE_WINK = 'wink' +SERVICE_XIAOMI_GW = 'xiaomi_gw' CONFIG_ENTRY_HANDLERS = { SERVICE_DAIKIN: 'daikin', diff --git a/homeassistant/components/dominos/__init__.py b/homeassistant/components/dominos/__init__.py index 2c9f763aaa8..1c8966f3b4b 100644 --- a/homeassistant/components/dominos/__init__.py +++ b/homeassistant/components/dominos/__init__.py @@ -1,24 +1,18 @@ -""" -Support for Dominos Pizza ordering. - -The Dominos Pizza component creates a service which can be invoked to order -from their menu - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/dominos/. -""" -import logging +"""Support for Dominos Pizza ordering.""" from datetime import timedelta +import logging import voluptuous as vol -import homeassistant.helpers.config_validation as cv from homeassistant.components import http from homeassistant.core import callback +import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity_component import EntityComponent from homeassistant.util import Throttle +REQUIREMENTS = ['pizzapi==0.0.3'] + _LOGGER = logging.getLogger(__name__) # The domain of your component. Should be equal to the name of your component. @@ -40,8 +34,6 @@ ATTR_ORDER_CODES = 'codes' MIN_TIME_BETWEEN_UPDATES = timedelta(minutes=10) MIN_TIME_BETWEEN_STORE_UPDATES = timedelta(minutes=3330) -REQUIREMENTS = ['pizzapi==0.0.3'] - DEPENDENCIES = ['http'] _ORDERS_SCHEMA = vol.Schema({ diff --git a/homeassistant/components/doorbird/__init__.py b/homeassistant/components/doorbird/__init__.py index 28747bbe8be..d477836425d 100644 --- a/homeassistant/components/doorbird/__init__.py +++ b/homeassistant/components/doorbird/__init__.py @@ -1,19 +1,15 @@ -""" -Support for DoorBird device. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/doorbird/ -""" +"""Support for DoorBird devices.""" import logging - from urllib.error import HTTPError + import voluptuous as vol from homeassistant.components.http import HomeAssistantView -from homeassistant.const import CONF_HOST, CONF_USERNAME, \ - CONF_PASSWORD, CONF_NAME, CONF_DEVICES, CONF_MONITORED_CONDITIONS +from homeassistant.const import ( + CONF_DEVICES, CONF_HOST, CONF_MONITORED_CONDITIONS, CONF_NAME, + CONF_PASSWORD, CONF_TOKEN, CONF_USERNAME) import homeassistant.helpers.config_validation as cv -from homeassistant.util import slugify, dt as dt_util +from homeassistant.util import dt as dt_util, slugify REQUIREMENTS = ['doorbirdpy==2.0.6'] @@ -28,7 +24,6 @@ CONF_DOORBELL_EVENTS = 'doorbell_events' CONF_DOORBELL_NUMS = 'doorbell_numbers' CONF_RELAY_NUMS = 'relay_numbers' CONF_MOTION_EVENTS = 'motion_events' -CONF_TOKEN = 'token' SENSOR_TYPES = { 'doorbell': { diff --git a/homeassistant/components/doorbird/camera.py b/homeassistant/components/doorbird/camera.py index 8982e6d0847..e201837aaf6 100644 --- a/homeassistant/components/doorbird/camera.py +++ b/homeassistant/components/doorbird/camera.py @@ -1,9 +1,4 @@ -""" -Support for viewing the camera feed from a DoorBird video doorbell. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/camera.doorbird/ -""" +"""Support for viewing the camera feed from a DoorBird video doorbell.""" import asyncio import datetime import logging diff --git a/homeassistant/components/dovado/__init__.py b/homeassistant/components/dovado/__init__.py index 7a50ac815b1..df2eed3011a 100644 --- a/homeassistant/components/dovado/__init__.py +++ b/homeassistant/components/dovado/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Dovado router. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/dovado/ -""" +"""Support for Dovado router.""" import logging from datetime import timedelta @@ -37,17 +32,14 @@ def setup(hass, config): hass.data[DOMAIN] = DovadoData( dovado.Dovado( - config[CONF_USERNAME], - config[CONF_PASSWORD], - config.get(CONF_HOST), - config.get(CONF_PORT) - ) + config[CONF_USERNAME], config[CONF_PASSWORD], + config.get(CONF_HOST), config.get(CONF_PORT)) ) return True class DovadoData: - """Maintains a connection to the router.""" + """Maintain a connection to the router.""" def __init__(self, client): """Set up a new Dovado connection.""" diff --git a/homeassistant/components/dovado/notify.py b/homeassistant/components/dovado/notify.py index 00036378a78..ea6ba2b455f 100644 --- a/homeassistant/components/dovado/notify.py +++ b/homeassistant/components/dovado/notify.py @@ -1,9 +1,4 @@ -""" -Support for SMS notifications from the Dovado router. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/notify.dovado/ -""" +"""Support for SMS notifications from the Dovado router.""" import logging from homeassistant.components.dovado import DOMAIN as DOVADO_DOMAIN diff --git a/homeassistant/components/dovado/sensor.py b/homeassistant/components/dovado/sensor.py index b89275b1795..eb0016ed298 100644 --- a/homeassistant/components/dovado/sensor.py +++ b/homeassistant/components/dovado/sensor.py @@ -1,9 +1,4 @@ -""" -Support for sensors from the Dovado router. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.dovado/ -""" +"""Support for sensors from the Dovado router.""" import logging import re from datetime import timedelta @@ -31,20 +26,16 @@ SENSOR_SMS_UNREAD = 'sms' SENSORS = { SENSOR_NETWORK: ('signal strength', 'Network', None, 'mdi:access-point-network'), - SENSOR_SIGNAL: ('signal strength', 'Signal Strength', '%', - 'mdi:signal'), + SENSOR_SIGNAL: ('signal strength', 'Signal Strength', '%', 'mdi:signal'), SENSOR_SMS_UNREAD: ('sms unread', 'SMS unread', '', 'mdi:message-text-outline'), - SENSOR_UPLOAD: ('traffic modem tx', 'Sent', 'GB', - 'mdi:cloud-upload'), + SENSOR_UPLOAD: ('traffic modem tx', 'Sent', 'GB', 'mdi:cloud-upload'), SENSOR_DOWNLOAD: ('traffic modem rx', 'Received', 'GB', 'mdi:cloud-download'), } PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ - vol.Required(CONF_SENSORS): vol.All( - cv.ensure_list, [vol.In(SENSORS)] - ), + vol.Required(CONF_SENSORS): vol.All(cv.ensure_list, [vol.In(SENSORS)]), }) @@ -69,6 +60,7 @@ class DovadoSensor(Entity): self._state = self._compute_state() def _compute_state(self): + """Compute the state of the sensor.""" state = self._data.state.get(SENSORS[self._sensor][0]) if self._sensor == SENSOR_NETWORK: match = re.search(r"\((.+)\)", state) diff --git a/homeassistant/components/downloader/__init__.py b/homeassistant/components/downloader/__init__.py index 0d57740a83d..5af367ef92d 100644 --- a/homeassistant/components/downloader/__init__.py +++ b/homeassistant/components/downloader/__init__.py @@ -1,9 +1,4 @@ -""" -Support for functionality to download files. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/downloader/ -""" +"""Support for functionality to download files.""" import logging import os import re diff --git a/homeassistant/components/duckdns/__init__.py b/homeassistant/components/duckdns/__init__.py index 3420bbed1bc..9899a0af98e 100644 --- a/homeassistant/components/duckdns/__init__.py +++ b/homeassistant/components/duckdns/__init__.py @@ -1,9 +1,4 @@ -""" -Integrate with DuckDNS. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/duckdns/ -""" +"""Integrate with DuckDNS.""" from datetime import timedelta import logging diff --git a/homeassistant/components/dweet/__init__.py b/homeassistant/components/dweet/__init__.py index d5f94bb2c7b..f8e5b181163 100644 --- a/homeassistant/components/dweet/__init__.py +++ b/homeassistant/components/dweet/__init__.py @@ -1,9 +1,4 @@ -""" -A component which allows you to send data to Dweet.io. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/dweet/ -""" +"""Support for sending data to Dweet.io.""" import logging from datetime import timedelta diff --git a/homeassistant/components/dweet/sensor.py b/homeassistant/components/dweet/sensor.py index 5f85164f35d..d1a64201e6d 100644 --- a/homeassistant/components/dweet/sensor.py +++ b/homeassistant/components/dweet/sensor.py @@ -1,9 +1,4 @@ -""" -Support for showing values from Dweet.io. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.dweet/ -""" +"""Support for showing values from Dweet.io.""" import json import logging from datetime import timedelta @@ -13,15 +8,13 @@ import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( - CONF_NAME, CONF_VALUE_TEMPLATE, CONF_UNIT_OF_MEASUREMENT) + CONF_NAME, CONF_VALUE_TEMPLATE, CONF_UNIT_OF_MEASUREMENT, CONF_DEVICE) from homeassistant.helpers.entity import Entity REQUIREMENTS = ['dweepy==0.3.0'] _LOGGER = logging.getLogger(__name__) -CONF_DEVICE = 'device' - DEFAULT_NAME = 'Dweet.io Sensor' SCAN_INTERVAL = timedelta(minutes=1) @@ -49,11 +42,11 @@ def setup_platform(hass, config, add_entities, discovery_info=None): content = json.dumps(dweepy.get_latest_dweet_for(device)[0]['content']) except dweepy.DweepyError: _LOGGER.error("Device/thing %s could not be found", device) - return False + return if value_template.render_with_possible_json_value(content) == '': _LOGGER.error("%s was not found", value_template) - return False + return dweet = DweetData(device) diff --git a/homeassistant/components/dyson/__init__.py b/homeassistant/components/dyson/__init__.py index 791f990d9ad..c2e56436bd8 100644 --- a/homeassistant/components/dyson/__init__.py +++ b/homeassistant/components/dyson/__init__.py @@ -1,29 +1,25 @@ -"""Parent component for Dyson Pure Cool Link devices. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/dyson/ -""" - +"""Support for Dyson Pure Cool Link devices.""" import logging import voluptuous as vol -import homeassistant.helpers.config_validation as cv +from homeassistant.const import ( + CONF_DEVICES, CONF_PASSWORD, CONF_TIMEOUT, CONF_USERNAME) from homeassistant.helpers import discovery -from homeassistant.const import CONF_USERNAME, CONF_PASSWORD, CONF_TIMEOUT, \ - CONF_DEVICES +import homeassistant.helpers.config_validation as cv REQUIREMENTS = ['libpurecoollink==0.4.2'] _LOGGER = logging.getLogger(__name__) -CONF_LANGUAGE = "language" -CONF_RETRY = "retry" +CONF_LANGUAGE = 'language' +CONF_RETRY = 'retry' DEFAULT_TIMEOUT = 5 DEFAULT_RETRY = 10 +DYSON_DEVICES = 'dyson_devices' -DOMAIN = "dyson" +DOMAIN = 'dyson' CONFIG_SCHEMA = vol.Schema({ DOMAIN: vol.Schema({ @@ -37,8 +33,6 @@ CONFIG_SCHEMA = vol.Schema({ }) }, extra=vol.ALLOW_EXTRA) -DYSON_DEVICES = "dyson_devices" - def setup(hass, config): """Set up the Dyson parent component.""" diff --git a/homeassistant/components/ebusd/__init__.py b/homeassistant/components/ebusd/__init__.py index 951e6f13b91..bc1b3aa9595 100644 --- a/homeassistant/components/ebusd/__init__.py +++ b/homeassistant/components/ebusd/__init__.py @@ -1,10 +1,4 @@ -""" -Support for Ebusd daemon for communication with eBUS heating systems. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/ebus/ -""" - +"""Support for Ebusd daemon for communication with eBUS heating systems.""" from datetime import timedelta import logging import socket @@ -53,13 +47,13 @@ def setup(hass, config): conf.get(CONF_HOST), conf.get(CONF_PORT)) try: - _LOGGER.debug("Ebusd component setup started.") + _LOGGER.debug("Ebusd component setup started") import ebusdpy ebusdpy.init(server_address) hass.data[DOMAIN] = EbusdData(server_address, circuit) sensor_config = { - 'monitored_conditions': monitored_conditions, + CONF_MONITORED_CONDITIONS: monitored_conditions, 'client_name': name, 'sensor_types': SENSOR_TYPES[circuit] } @@ -68,7 +62,7 @@ def setup(hass, config): hass.services.register( DOMAIN, SERVICE_EBUSD_WRITE, hass.data[DOMAIN].write) - _LOGGER.debug("Ebusd component setup completed.") + _LOGGER.debug("Ebusd component setup completed") return True except (socket.timeout, socket.error): return False diff --git a/homeassistant/components/ebusd/sensor.py b/homeassistant/components/ebusd/sensor.py index 24ca263898c..942ba107509 100644 --- a/homeassistant/components/ebusd/sensor.py +++ b/homeassistant/components/ebusd/sensor.py @@ -1,10 +1,4 @@ -""" -Support for Ebusd daemon for communication with eBUS heating systems. - -For more details about ebusd deamon, please refer to the documentation at -https://github.com/john30/ebusd -""" - +"""Support for Ebusd sensors.""" import logging import datetime diff --git a/homeassistant/components/ecoal_boiler/__init__.py b/homeassistant/components/ecoal_boiler/__init__.py index bd08024e64a..6ab9fc3181c 100644 --- a/homeassistant/components/ecoal_boiler/__init__.py +++ b/homeassistant/components/ecoal_boiler/__init__.py @@ -1,9 +1,4 @@ -""" -Component to control ecoal/esterownik.pl coal/wood boiler controller. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/ecoal_boiler/ -""" +"""Support to control ecoal/esterownik.pl coal/wood boiler controller.""" import logging import voluptuous as vol @@ -61,12 +56,10 @@ SENSOR_SCHEMA = vol.Schema({ CONFIG_SCHEMA = vol.Schema({ DOMAIN: vol.Schema({ vol.Required(CONF_HOST): cv.string, - vol.Optional(CONF_USERNAME, - default=DEFAULT_USERNAME): cv.string, - vol.Optional(CONF_PASSWORD, - default=DEFAULT_PASSWORD): cv.string, - vol.Optional(CONF_SWITCHES, default={}): SWITCH_SCHEMA, + vol.Optional(CONF_PASSWORD, default=DEFAULT_PASSWORD): cv.string, vol.Optional(CONF_SENSORS, default={}): SENSOR_SCHEMA, + vol.Optional(CONF_SWITCHES, default={}): SWITCH_SCHEMA, + vol.Optional(CONF_USERNAME, default=DEFAULT_USERNAME): cv.string, }) }, extra=vol.ALLOW_EXTRA) diff --git a/homeassistant/components/ecoal_boiler/sensor.py b/homeassistant/components/ecoal_boiler/sensor.py index de81d16470c..47ed2d6ebdf 100644 --- a/homeassistant/components/ecoal_boiler/sensor.py +++ b/homeassistant/components/ecoal_boiler/sensor.py @@ -1,9 +1,4 @@ -""" -Allows reading temperatures from ecoal/esterownik.pl controller. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.ecoal_boiler/ -""" +"""Allows reading temperatures from ecoal/esterownik.pl controller.""" import logging from homeassistant.components.ecoal_boiler import ( diff --git a/homeassistant/components/ecoal_boiler/switch.py b/homeassistant/components/ecoal_boiler/switch.py index d8d6c98bb8b..f113125194a 100644 --- a/homeassistant/components/ecoal_boiler/switch.py +++ b/homeassistant/components/ecoal_boiler/switch.py @@ -1,9 +1,4 @@ -""" -Allows to configuration ecoal (esterownik.pl) pumps as switches. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.ecoal_boiler/ -""" +"""Allows to configuration ecoal (esterownik.pl) pumps as switches.""" import logging from typing import Optional diff --git a/homeassistant/components/ecobee/__init__.py b/homeassistant/components/ecobee/__init__.py index 3829c2caebd..167132a5f41 100644 --- a/homeassistant/components/ecobee/__init__.py +++ b/homeassistant/components/ecobee/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Ecobee. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/ecobee/ -""" +"""Support for Ecobee devices.""" import logging import os from datetime import timedelta @@ -34,7 +29,7 @@ NETWORK = None CONFIG_SCHEMA = vol.Schema({ DOMAIN: vol.Schema({ vol.Optional(CONF_API_KEY): cv.string, - vol.Optional(CONF_HOLD_TEMP, default=False): cv.boolean + vol.Optional(CONF_HOLD_TEMP, default=False): cv.boolean, }) }, extra=vol.ALLOW_EXTRA) diff --git a/homeassistant/components/ecobee/binary_sensor.py b/homeassistant/components/ecobee/binary_sensor.py index 37f25476bd0..ca8e551bf5e 100644 --- a/homeassistant/components/ecobee/binary_sensor.py +++ b/homeassistant/components/ecobee/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for Ecobee sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.ecobee/ -""" +"""Support for Ecobee binary sensors.""" from homeassistant.components import ecobee from homeassistant.components.binary_sensor import BinarySensorDevice @@ -33,7 +28,7 @@ class EcobeeBinarySensor(BinarySensorDevice): """Representation of an Ecobee sensor.""" def __init__(self, sensor_name, sensor_index): - """Initialize the sensor.""" + """Initialize the Ecobee sensor.""" self._name = sensor_name + ' Occupancy' self.sensor_name = sensor_name self.index = sensor_index diff --git a/homeassistant/components/ecobee/climate.py b/homeassistant/components/ecobee/climate.py index 46fc5c29752..aa6440894e1 100644 --- a/homeassistant/components/ecobee/climate.py +++ b/homeassistant/components/ecobee/climate.py @@ -1,9 +1,4 @@ -""" -Platform for Ecobee Thermostats. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/climate.ecobee/ -""" +"""Support for Ecobee Thermostats.""" import logging import voluptuous as vol diff --git a/homeassistant/components/ecobee/notify.py b/homeassistant/components/ecobee/notify.py index 31e4c4751c8..9824d20b85e 100644 --- a/homeassistant/components/ecobee/notify.py +++ b/homeassistant/components/ecobee/notify.py @@ -1,9 +1,4 @@ -""" -Support for ecobee Send Message service. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/notify.ecobee/ -""" +"""Support for Ecobee Send Message service.""" import logging import voluptuous as vol diff --git a/homeassistant/components/ecobee/sensor.py b/homeassistant/components/ecobee/sensor.py index ae22401a618..1f9fd5cbde8 100644 --- a/homeassistant/components/ecobee/sensor.py +++ b/homeassistant/components/ecobee/sensor.py @@ -1,9 +1,4 @@ -""" -Support for Ecobee sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.ecobee/ -""" +"""Support for Ecobee sensors.""" from homeassistant.components import ecobee from homeassistant.const import ( DEVICE_CLASS_HUMIDITY, DEVICE_CLASS_TEMPERATURE, TEMP_FAHRENHEIT) diff --git a/homeassistant/components/ecobee/weather.py b/homeassistant/components/ecobee/weather.py index 7382e5c1815..2ba5f362b7d 100644 --- a/homeassistant/components/ecobee/weather.py +++ b/homeassistant/components/ecobee/weather.py @@ -1,9 +1,4 @@ -""" -Support for displaying weather info from Ecobee API. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/weather.ecobee/ -""" +"""Support for displaying weather info from Ecobee API.""" from datetime import datetime from homeassistant.components import ecobee @@ -23,7 +18,7 @@ MISSING_DATA = -5002 def setup_platform(hass, config, add_entities, discovery_info=None): - """Set up the Ecobee weather component.""" + """Set up the Ecobee weather platform.""" if discovery_info is None: return dev = list() diff --git a/homeassistant/components/ecovacs/__init__.py b/homeassistant/components/ecovacs/__init__.py index 8cbe95ee685..124cae3ca47 100644 --- a/homeassistant/components/ecovacs/__init__.py +++ b/homeassistant/components/ecovacs/__init__.py @@ -1,19 +1,14 @@ -"""Parent component for Ecovacs Deebot vacuums. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/ecovacs/ -""" - +"""Support for Ecovacs Deebot vacuums.""" import logging import random import string import voluptuous as vol -import homeassistant.helpers.config_validation as cv +from homeassistant.const import ( + CONF_PASSWORD, CONF_USERNAME, EVENT_HOMEASSISTANT_STOP) from homeassistant.helpers import discovery -from homeassistant.const import CONF_USERNAME, CONF_PASSWORD, \ - EVENT_HOMEASSISTANT_STOP +import homeassistant.helpers.config_validation as cv REQUIREMENTS = ['sucks==0.9.3'] diff --git a/homeassistant/components/ecovacs/vacuum.py b/homeassistant/components/ecovacs/vacuum.py index 7f05554c496..9d2af730315 100644 --- a/homeassistant/components/ecovacs/vacuum.py +++ b/homeassistant/components/ecovacs/vacuum.py @@ -1,9 +1,4 @@ -""" -Support for Ecovacs Ecovacs Vaccums. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/vacuum.ecovacs/ -""" +"""Support for Ecovacs Ecovacs Vaccums.""" import logging from homeassistant.components.vacuum import ( diff --git a/homeassistant/components/edp_redy/__init__.py b/homeassistant/components/edp_redy/__init__.py index 10780103613..9b8bfaa437a 100644 --- a/homeassistant/components/edp_redy/__init__.py +++ b/homeassistant/components/edp_redy/__init__.py @@ -1,19 +1,13 @@ -""" -Support for EDP re:dy. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/edp_redy/ -""" - -import logging +"""Support for EDP re:dy.""" from datetime import timedelta +import logging import voluptuous as vol -from homeassistant.const import (CONF_USERNAME, CONF_PASSWORD, - EVENT_HOMEASSISTANT_START) +from homeassistant.const import ( + CONF_PASSWORD, CONF_USERNAME, EVENT_HOMEASSISTANT_START) from homeassistant.core import callback -from homeassistant.helpers import discovery, dispatcher, aiohttp_client +from homeassistant.helpers import aiohttp_client, discovery, dispatcher import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity from homeassistant.helpers.event import async_track_point_in_time diff --git a/homeassistant/components/edp_redy/sensor.py b/homeassistant/components/edp_redy/sensor.py index 0f259ec673a..926a073832c 100644 --- a/homeassistant/components/edp_redy/sensor.py +++ b/homeassistant/components/edp_redy/sensor.py @@ -13,8 +13,8 @@ DEPENDENCIES = ['edp_redy'] ATTR_ACTIVE_POWER = 'active_power' -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Perform the setup for re:dy devices.""" from edp_redy.session import ACTIVE_POWER_ID diff --git a/homeassistant/components/edp_redy/switch.py b/homeassistant/components/edp_redy/switch.py index 1576361da33..ad4ce8fe728 100644 --- a/homeassistant/components/edp_redy/switch.py +++ b/homeassistant/components/edp_redy/switch.py @@ -12,8 +12,8 @@ DEPENDENCIES = ['edp_redy'] ATTR_ACTIVE_POWER = 'active_power' -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Perform the setup for re:dy devices.""" session = hass.data[EDP_REDY] devices = [] diff --git a/homeassistant/components/egardia/__init__.py b/homeassistant/components/egardia/__init__.py index 3547f4fc76e..fe613824c95 100644 --- a/homeassistant/components/egardia/__init__.py +++ b/homeassistant/components/egardia/__init__.py @@ -1,28 +1,24 @@ -""" -Interfaces with Egardia/Woonveilig alarm control panel. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/egardia/ -""" +"""Interfaces with Egardia/Woonveilig alarm control panel.""" import logging import requests import voluptuous as vol +from homeassistant.const import ( + CONF_HOST, CONF_NAME, CONF_PASSWORD, CONF_PORT, CONF_USERNAME, + EVENT_HOMEASSISTANT_STOP) from homeassistant.helpers import discovery import homeassistant.helpers.config_validation as cv -from homeassistant.const import ( - CONF_PORT, CONF_HOST, CONF_PASSWORD, CONF_USERNAME, CONF_NAME, - EVENT_HOMEASSISTANT_STOP) REQUIREMENTS = ['pythonegardia==1.0.39'] _LOGGER = logging.getLogger(__name__) +ATTR_DISCOVER_DEVICES = 'egardia_sensor' + CONF_REPORT_SERVER_CODES = 'report_server_codes' CONF_REPORT_SERVER_ENABLED = 'report_server_enabled' CONF_REPORT_SERVER_PORT = 'report_server_port' -REPORT_SERVER_CODES_IGNORE = 'ignore' CONF_VERSION = 'version' DEFAULT_NAME = 'Egardia' @@ -31,21 +27,24 @@ DEFAULT_REPORT_SERVER_ENABLED = False DEFAULT_REPORT_SERVER_PORT = 52010 DEFAULT_VERSION = 'GATE-01' DOMAIN = 'egardia' -EGARDIA_SERVER = 'egardia_server' + EGARDIA_DEVICE = 'egardiadevice' EGARDIA_NAME = 'egardianame' -EGARDIA_REPORT_SERVER_ENABLED = 'egardia_rs_enabled' EGARDIA_REPORT_SERVER_CODES = 'egardia_rs_codes' +EGARDIA_REPORT_SERVER_ENABLED = 'egardia_rs_enabled' +EGARDIA_SERVER = 'egardia_server' + NOTIFICATION_ID = 'egardia_notification' NOTIFICATION_TITLE = 'Egardia' -ATTR_DISCOVER_DEVICES = 'egardia_sensor' + +REPORT_SERVER_CODES_IGNORE = 'ignore' SERVER_CODE_SCHEMA = vol.Schema({ vol.Optional('arm'): vol.All(cv.ensure_list_csv, [cv.string]), vol.Optional('disarm'): vol.All(cv.ensure_list_csv, [cv.string]), vol.Optional('armhome'): vol.All(cv.ensure_list_csv, [cv.string]), vol.Optional('triggered'): vol.All(cv.ensure_list_csv, [cv.string]), - vol.Optional('ignore'): vol.All(cv.ensure_list_csv, [cv.string]) + vol.Optional('ignore'): vol.All(cv.ensure_list_csv, [cv.string]), }) CONFIG_SCHEMA = vol.Schema({ @@ -82,10 +81,10 @@ def setup(hass, config): host, port, username, password, '', version) except requests.exceptions.RequestException: _LOGGER.error("An error occurred accessing your Egardia device. " - "Please check config.") + "Please check configuration") return False except egardiadevice.UnauthorizedError: - _LOGGER.error("Unable to authorize. Wrong password or username.") + _LOGGER.error("Unable to authorize. Wrong password or username") return False # Set up the egardia server if enabled if rs_enabled: @@ -101,21 +100,21 @@ def setup(hass, config): server.start() def handle_stop_event(event): - """Handle HA stop event.""" + """Handle Home Assistant stop event.""" server.stop() # listen to home assistant stop event hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, handle_stop_event) except IOError: - _LOGGER.error("Binding error occurred while starting " - "EgardiaServer.") + _LOGGER.error( + "Binding error occurred while starting EgardiaServer") return False discovery.load_platform(hass, 'alarm_control_panel', DOMAIN, discovered=conf, hass_config=config) - # get the sensors from the device and add those + # Get the sensors from the device and add those sensors = device.getsensors() discovery.load_platform(hass, 'binary_sensor', DOMAIN, {ATTR_DISCOVER_DEVICES: sensors}, config) diff --git a/homeassistant/components/egardia/alarm_control_panel.py b/homeassistant/components/egardia/alarm_control_panel.py index dfd60c4abde..e202a46f9f1 100644 --- a/homeassistant/components/egardia/alarm_control_panel.py +++ b/homeassistant/components/egardia/alarm_control_panel.py @@ -1,23 +1,17 @@ -""" -Interfaces with Egardia/Woonveilig alarm control panel. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/alarm_control_panel.egardia/ -""" +"""Interfaces with Egardia/Woonveilig alarm control panel.""" import logging import requests import homeassistant.components.alarm_control_panel as alarm -from homeassistant.const import ( - STATE_ALARM_DISARMED, STATE_ALARM_ARMED_HOME, - STATE_ALARM_ARMED_AWAY, STATE_ALARM_TRIGGERED, - STATE_ALARM_ARMED_NIGHT) from homeassistant.components.egardia import ( - EGARDIA_DEVICE, EGARDIA_SERVER, - REPORT_SERVER_CODES_IGNORE, CONF_REPORT_SERVER_CODES, - CONF_REPORT_SERVER_ENABLED, CONF_REPORT_SERVER_PORT - ) + CONF_REPORT_SERVER_CODES, CONF_REPORT_SERVER_ENABLED, + CONF_REPORT_SERVER_PORT, EGARDIA_DEVICE, EGARDIA_SERVER, + REPORT_SERVER_CODES_IGNORE) +from homeassistant.const import ( + STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_NIGHT, + STATE_ALARM_DISARMED, STATE_ALARM_TRIGGERED) + DEPENDENCIES = ['egardia'] _LOGGER = logging.getLogger(__name__) @@ -34,7 +28,7 @@ STATES = { def setup_platform(hass, config, add_entities, discovery_info=None): - """Set up the Egardia platform.""" + """Set up the Egardia Alarm Control Panael platform.""" if discovery_info is None: return device = EgardiaAlarm( @@ -43,7 +37,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): discovery_info[CONF_REPORT_SERVER_ENABLED], discovery_info.get(CONF_REPORT_SERVER_CODES), discovery_info[CONF_REPORT_SERVER_PORT]) - # add egardia alarm device + add_entities([device], True) diff --git a/homeassistant/components/egardia/binary_sensor.py b/homeassistant/components/egardia/binary_sensor.py index 56d7dda17ba..74a048a86c0 100644 --- a/homeassistant/components/egardia/binary_sensor.py +++ b/homeassistant/components/egardia/binary_sensor.py @@ -1,20 +1,20 @@ -""" -Interfaces with Egardia/Woonveilig alarm control panel. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.egardia/ -""" +"""Interfaces with Egardia/Woonveilig alarm control panel.""" import logging from homeassistant.components.binary_sensor import BinarySensorDevice -from homeassistant.const import STATE_ON, STATE_OFF from homeassistant.components.egardia import ( - EGARDIA_DEVICE, ATTR_DISCOVER_DEVICES) + ATTR_DISCOVER_DEVICES, EGARDIA_DEVICE) +from homeassistant.const import STATE_OFF, STATE_ON + _LOGGER = logging.getLogger(__name__) + DEPENDENCIES = ['egardia'] -EGARDIA_TYPE_TO_DEVICE_CLASS = {'IR Sensor': 'motion', - 'Door Contact': 'opening', - 'IR': 'motion'} + +EGARDIA_TYPE_TO_DEVICE_CLASS = { + 'IR Sensor': 'motion', + 'Door Contact': 'opening', + 'IR': 'motion', +} async def async_setup_platform(hass, config, async_add_entities, @@ -25,7 +25,7 @@ async def async_setup_platform(hass, config, async_add_entities, return disc_info = discovery_info[ATTR_DISCOVER_DEVICES] - # multiple devices here! + async_add_entities( ( EgardiaBinarySensor( diff --git a/homeassistant/components/eight_sleep/__init__.py b/homeassistant/components/eight_sleep/__init__.py index 8c36830817e..851fd3d1c31 100644 --- a/homeassistant/components/eight_sleep/__init__.py +++ b/homeassistant/components/eight_sleep/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Eight smart mattress covers and mattresses. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/eight_sleep/ -""" +"""Support for Eight smart mattress covers and mattresses.""" import logging from datetime import timedelta diff --git a/homeassistant/components/eight_sleep/binary_sensor.py b/homeassistant/components/eight_sleep/binary_sensor.py index 34d3a7a13ca..2a9cb19a327 100644 --- a/homeassistant/components/eight_sleep/binary_sensor.py +++ b/homeassistant/components/eight_sleep/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for Eight Sleep binary sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.eight_sleep/ -""" +"""Support for Eight Sleep binary sensors.""" import logging from homeassistant.components.binary_sensor import BinarySensorDevice diff --git a/homeassistant/components/eight_sleep/sensor.py b/homeassistant/components/eight_sleep/sensor.py index 0fc793d31ca..2bb03c8d4f2 100644 --- a/homeassistant/components/eight_sleep/sensor.py +++ b/homeassistant/components/eight_sleep/sensor.py @@ -1,9 +1,4 @@ -""" -Support for Eight Sleep sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.eight_sleep/ -""" +"""Support for Eight Sleep sensors.""" import logging from homeassistant.components.eight_sleep import ( diff --git a/homeassistant/components/elkm1/__init__.py b/homeassistant/components/elkm1/__init__.py index 8ac3cec6411..a0c08bf5429 100644 --- a/homeassistant/components/elkm1/__init__.py +++ b/homeassistant/components/elkm1/__init__.py @@ -1,10 +1,4 @@ -""" -Support the ElkM1 Gold and ElkM1 EZ8 alarm / integration panels. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/elkm1/ -""" - +"""Support the ElkM1 Gold and ElkM1 EZ8 alarm/integration panels.""" import logging import re @@ -18,20 +12,20 @@ from homeassistant.helpers import discovery from homeassistant.helpers.entity import Entity from homeassistant.helpers.typing import ConfigType # noqa -DOMAIN = "elkm1" - REQUIREMENTS = ['elkm1-lib==0.7.13'] +DOMAIN = 'elkm1' + CONF_AREA = 'area' CONF_COUNTER = 'counter' +CONF_ENABLED = 'enabled' CONF_KEYPAD = 'keypad' CONF_OUTPUT = 'output' +CONF_PLC = 'plc' CONF_SETTING = 'setting' CONF_TASK = 'task' CONF_THERMOSTAT = 'thermostat' -CONF_PLC = 'plc' CONF_ZONE = 'zone' -CONF_ENABLED = 'enabled' _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/elkm1/alarm_control_panel.py b/homeassistant/components/elkm1/alarm_control_panel.py index c6405f953fd..63b38c1d321 100644 --- a/homeassistant/components/elkm1/alarm_control_panel.py +++ b/homeassistant/components/elkm1/alarm_control_panel.py @@ -1,10 +1,4 @@ -""" -Each ElkM1 area will be created as a separate alarm_control_panel in HASS. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/alarm_control_panel.elkm1/ -""" - +"""Each ElkM1 area will be created as a separate alarm_control_panel.""" import voluptuous as vol import homeassistant.components.alarm_control_panel as alarm from homeassistant.const import ( diff --git a/homeassistant/components/elkm1/climate.py b/homeassistant/components/elkm1/climate.py index 6bd33b382dc..467d542ee6d 100644 --- a/homeassistant/components/elkm1/climate.py +++ b/homeassistant/components/elkm1/climate.py @@ -1,9 +1,4 @@ -""" -Support for control of Elk-M1 connected thermostats. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/climate.elkm1/ -""" +"""Support for control of Elk-M1 connected thermostats.""" from homeassistant.components.climate import ( ATTR_TARGET_TEMP_HIGH, ATTR_TARGET_TEMP_LOW, PRECISION_WHOLE, STATE_AUTO, STATE_COOL, STATE_FAN_ONLY, STATE_HEAT, STATE_IDLE, SUPPORT_AUX_HEAT, diff --git a/homeassistant/components/elkm1/light.py b/homeassistant/components/elkm1/light.py index 707aedbb161..3a282595d58 100644 --- a/homeassistant/components/elkm1/light.py +++ b/homeassistant/components/elkm1/light.py @@ -1,10 +1,4 @@ -""" -Support for control of ElkM1 lighting (X10, UPB, etc). - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/light.elkm1/ -""" - +"""Support for control of ElkM1 lighting (X10, UPB, etc).""" from homeassistant.components.light import ( ATTR_BRIGHTNESS, SUPPORT_BRIGHTNESS, Light) from homeassistant.components.elkm1 import ( @@ -13,8 +7,8 @@ from homeassistant.components.elkm1 import ( DEPENDENCIES = [ELK_DOMAIN] -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up the Elk light platform.""" if discovery_info is None: return @@ -24,10 +18,10 @@ async def async_setup_platform(hass, config, async_add_entities, class ElkLight(ElkEntity, Light): - """Elk lighting device.""" + """Representation of an Elk lighting device.""" def __init__(self, element, elk, elk_data): - """Initialize light.""" + """Initialize the Elk light.""" super().__init__(element, elk, elk_data) self._brightness = self._element.status diff --git a/homeassistant/components/elkm1/scene.py b/homeassistant/components/elkm1/scene.py index 47dd17a56ae..c8583b1d8bf 100644 --- a/homeassistant/components/elkm1/scene.py +++ b/homeassistant/components/elkm1/scene.py @@ -1,11 +1,4 @@ -""" -Support for control of ElkM1 tasks ("macros"). - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/scene.elkm1/ -""" - - +"""Support for control of ElkM1 tasks ("macros").""" from homeassistant.components.elkm1 import ( DOMAIN as ELK_DOMAIN, ElkEntity, create_elk_entities) from homeassistant.components.scene import Scene @@ -13,8 +6,8 @@ from homeassistant.components.scene import Scene DEPENDENCIES = [ELK_DOMAIN] -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Create the Elk-M1 scene platform.""" if discovery_info is None: return diff --git a/homeassistant/components/elkm1/sensor.py b/homeassistant/components/elkm1/sensor.py index 3fd57b190a6..63da6ea5376 100644 --- a/homeassistant/components/elkm1/sensor.py +++ b/homeassistant/components/elkm1/sensor.py @@ -1,17 +1,12 @@ -""" -Support for control of ElkM1 sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.elkm1/ -""" +"""Support for control of ElkM1 sensors.""" from homeassistant.components.elkm1 import ( DOMAIN as ELK_DOMAIN, create_elk_entities, ElkEntity) DEPENDENCIES = [ELK_DOMAIN] -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Create the Elk-M1 sensor platform.""" if discovery_info is None: return diff --git a/homeassistant/components/elkm1/switch.py b/homeassistant/components/elkm1/switch.py index a838e1b948e..7badd6ee5dc 100644 --- a/homeassistant/components/elkm1/switch.py +++ b/homeassistant/components/elkm1/switch.py @@ -1,11 +1,4 @@ -""" -Support for control of ElkM1 outputs (relays). - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.elkm1/ -""" - - +"""Support for control of ElkM1 outputs (relays).""" from homeassistant.components.elkm1 import ( DOMAIN as ELK_DOMAIN, ElkEntity, create_elk_entities) from homeassistant.components.switch import SwitchDevice @@ -13,8 +6,8 @@ from homeassistant.components.switch import SwitchDevice DEPENDENCIES = [ELK_DOMAIN] -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Create the Elk-M1 switch platform.""" if discovery_info is None: return diff --git a/homeassistant/components/emoncms_history/__init__.py b/homeassistant/components/emoncms_history/__init__.py index 6a92ab64044..45fb358cecc 100644 --- a/homeassistant/components/emoncms_history/__init__.py +++ b/homeassistant/components/emoncms_history/__init__.py @@ -1,9 +1,4 @@ -""" -A component which allows you to send data to Emoncms. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/emoncms_history/ -""" +"""Support for sending data to Emoncms.""" import logging from datetime import timedelta diff --git a/homeassistant/components/emulated_hue/__init__.py b/homeassistant/components/emulated_hue/__init__.py index 07ecb9d265a..c8ed263a2dc 100644 --- a/homeassistant/components/emulated_hue/__init__.py +++ b/homeassistant/components/emulated_hue/__init__.py @@ -1,9 +1,4 @@ -""" -Support for local control of entities by emulating the Phillips Hue bridge. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/emulated_hue/ -""" +"""Support for local control of entities by emulating a Phillips Hue bridge.""" import logging from aiohttp import web @@ -31,18 +26,18 @@ _LOGGER = logging.getLogger(__name__) NUMBERS_FILE = 'emulated_hue_ids.json' -CONF_HOST_IP = 'host_ip' -CONF_LISTEN_PORT = 'listen_port' CONF_ADVERTISE_IP = 'advertise_ip' CONF_ADVERTISE_PORT = 'advertise_port' -CONF_UPNP_BIND_MULTICAST = 'upnp_bind_multicast' -CONF_OFF_MAPS_TO_ON_DOMAINS = 'off_maps_to_on_domains' +CONF_ENTITIES = 'entities' +CONF_ENTITY_HIDDEN = 'hidden' +CONF_ENTITY_NAME = 'name' CONF_EXPOSE_BY_DEFAULT = 'expose_by_default' CONF_EXPOSED_DOMAINS = 'exposed_domains' +CONF_HOST_IP = 'host_ip' +CONF_LISTEN_PORT = 'listen_port' +CONF_OFF_MAPS_TO_ON_DOMAINS = 'off_maps_to_on_domains' CONF_TYPE = 'type' -CONF_ENTITIES = 'entities' -CONF_ENTITY_NAME = 'name' -CONF_ENTITY_HIDDEN = 'hidden' +CONF_UPNP_BIND_MULTICAST = 'upnp_bind_multicast' TYPE_ALEXA = 'alexa' TYPE_GOOGLE = 'google_home' diff --git a/homeassistant/components/emulated_hue/hue_api.py b/homeassistant/components/emulated_hue/hue_api.py index fdf1d35201e..95b3c470d9e 100644 --- a/homeassistant/components/emulated_hue/hue_api.py +++ b/homeassistant/components/emulated_hue/hue_api.py @@ -1,4 +1,4 @@ -"""Provides a Hue API to control Home Assistant.""" +"""Support for a Hue API to control Home Assistant.""" import logging from aiohttp import web @@ -33,7 +33,6 @@ from homeassistant.components.http import HomeAssistantView from homeassistant.components.http.const import KEY_REAL_IP from homeassistant.util.network import is_local - _LOGGER = logging.getLogger(__name__) HUE_API_STATE_ON = 'on' diff --git a/homeassistant/components/emulated_hue/upnp.py b/homeassistant/components/emulated_hue/upnp.py index 548b6f3d771..a163d4b2e91 100644 --- a/homeassistant/components/emulated_hue/upnp.py +++ b/homeassistant/components/emulated_hue/upnp.py @@ -1,4 +1,4 @@ -"""Provides a UPNP discovery method that mimics Hue hubs.""" +"""Support UPNP discovery method that mimics Hue hubs.""" import threading import socket import logging diff --git a/homeassistant/components/emulated_roku/__init__.py b/homeassistant/components/emulated_roku/__init__.py index 4dec1d5602a..ef87e14ec43 100644 --- a/homeassistant/components/emulated_roku/__init__.py +++ b/homeassistant/components/emulated_roku/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Roku API emulation. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/emulated_roku/ -""" +"""Support for Roku API emulation.""" import voluptuous as vol from homeassistant import config_entries, util diff --git a/homeassistant/components/emulated_roku/config_flow.py b/homeassistant/components/emulated_roku/config_flow.py index f2d56f84681..d08ad09f1c0 100644 --- a/homeassistant/components/emulated_roku/config_flow.py +++ b/homeassistant/components/emulated_roku/config_flow.py @@ -1,5 +1,4 @@ """Config flow to configure emulated_roku component.""" - import voluptuous as vol from homeassistant import config_entries diff --git a/homeassistant/components/emulated_roku/const.py b/homeassistant/components/emulated_roku/const.py index f4a034e31ac..25ea3adaa84 100644 --- a/homeassistant/components/emulated_roku/const.py +++ b/homeassistant/components/emulated_roku/const.py @@ -1,5 +1,4 @@ """Constants for the emulated_roku component.""" - DOMAIN = 'emulated_roku' CONF_SERVERS = 'servers' diff --git a/homeassistant/components/enocean/__init__.py b/homeassistant/components/enocean/__init__.py index 75e456f62bd..8b3c27025cd 100644 --- a/homeassistant/components/enocean/__init__.py +++ b/homeassistant/components/enocean/__init__.py @@ -1,9 +1,4 @@ -""" -EnOcean Component. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/EnOcean/ -""" +"""Support for EnOcean devices.""" import logging import voluptuous as vol diff --git a/homeassistant/components/enocean/binary_sensor.py b/homeassistant/components/enocean/binary_sensor.py index c883897c2ea..1fde8c79e40 100644 --- a/homeassistant/components/enocean/binary_sensor.py +++ b/homeassistant/components/enocean/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for EnOcean binary sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.enocean/ -""" +"""Support for EnOcean binary sensors.""" import logging import voluptuous as vol diff --git a/homeassistant/components/enocean/light.py b/homeassistant/components/enocean/light.py index ebe2c409796..f574f89f951 100644 --- a/homeassistant/components/enocean/light.py +++ b/homeassistant/components/enocean/light.py @@ -1,9 +1,4 @@ -""" -Support for EnOcean light sources. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/light.enocean/ -""" +"""Support for EnOcean light sources.""" import logging import math diff --git a/homeassistant/components/enocean/sensor.py b/homeassistant/components/enocean/sensor.py index 02e6812d5d5..d2e88ed3825 100644 --- a/homeassistant/components/enocean/sensor.py +++ b/homeassistant/components/enocean/sensor.py @@ -1,9 +1,4 @@ -""" -Support for EnOcean sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.enocean/ -""" +"""Support for EnOcean sensors.""" import logging import voluptuous as vol diff --git a/homeassistant/components/enocean/switch.py b/homeassistant/components/enocean/switch.py index ab979604f50..4dfbafd36b1 100644 --- a/homeassistant/components/enocean/switch.py +++ b/homeassistant/components/enocean/switch.py @@ -1,9 +1,4 @@ -""" -Support for EnOcean switches. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.enocean/ -""" +"""Support for EnOcean switches.""" import logging import voluptuous as vol diff --git a/homeassistant/components/envisalink/__init__.py b/homeassistant/components/envisalink/__init__.py index 8b89b307db9..b7590341f78 100644 --- a/homeassistant/components/envisalink/__init__.py +++ b/homeassistant/components/envisalink/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Envisalink devices. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/envisalink/ -""" +"""Support for Envisalink devices.""" import asyncio import logging diff --git a/homeassistant/components/envisalink/alarm_control_panel.py b/homeassistant/components/envisalink/alarm_control_panel.py index 9b772d9bdf0..a4cc5864fc4 100644 --- a/homeassistant/components/envisalink/alarm_control_panel.py +++ b/homeassistant/components/envisalink/alarm_control_panel.py @@ -1,9 +1,4 @@ -""" -Support for Envisalink-based alarm control panels (Honeywell/DSC). - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/alarm_control_panel.envisalink/ -""" +"""Support for Envisalink-based alarm control panels (Honeywell/DSC).""" import logging import voluptuous as vol @@ -31,8 +26,8 @@ ALARM_KEYPRESS_SCHEMA = vol.Schema({ }) -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Perform the setup for Envisalink alarm panels.""" configured_partitions = discovery_info['partitions'] code = discovery_info[CONF_CODE] @@ -42,14 +37,9 @@ async def async_setup_platform(hass, config, async_add_entities, for part_num in configured_partitions: device_config_data = PARTITION_SCHEMA(configured_partitions[part_num]) device = EnvisalinkAlarm( - hass, - part_num, - device_config_data[CONF_PARTITIONNAME], - code, - panic_type, - hass.data[DATA_EVL].alarm_state['partition'][part_num], - hass.data[DATA_EVL] - ) + hass, part_num, device_config_data[CONF_PARTITIONNAME], code, + panic_type, hass.data[DATA_EVL].alarm_state['partition'][part_num], + hass.data[DATA_EVL]) devices.append(device) async_add_entities(devices) diff --git a/homeassistant/components/envisalink/binary_sensor.py b/homeassistant/components/envisalink/binary_sensor.py index 276ace8dd51..26b54e16cc8 100644 --- a/homeassistant/components/envisalink/binary_sensor.py +++ b/homeassistant/components/envisalink/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for Envisalink zone states- represented as binary sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.envisalink/ -""" +"""Support for Envisalink zone states- represented as binary sensors.""" import logging import datetime diff --git a/homeassistant/components/envisalink/sensor.py b/homeassistant/components/envisalink/sensor.py index aed2b056d2f..cc6a8b87232 100644 --- a/homeassistant/components/envisalink/sensor.py +++ b/homeassistant/components/envisalink/sensor.py @@ -1,9 +1,4 @@ -""" -Support for Envisalink sensors (shows panel info). - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.envisalink/ -""" +"""Support for Envisalink sensors (shows panel info).""" import logging from homeassistant.core import callback @@ -18,8 +13,8 @@ _LOGGER = logging.getLogger(__name__) DEPENDENCIES = ['envisalink'] -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Perform the setup for Envisalink sensor devices.""" configured_partitions = discovery_info['partitions'] @@ -27,11 +22,10 @@ async def async_setup_platform(hass, config, async_add_entities, for part_num in configured_partitions: device_config_data = PARTITION_SCHEMA(configured_partitions[part_num]) device = EnvisalinkSensor( - hass, - device_config_data[CONF_PARTITIONNAME], - part_num, + hass, device_config_data[CONF_PARTITIONNAME], part_num, hass.data[DATA_EVL].alarm_state['partition'][part_num], hass.data[DATA_EVL]) + devices.append(device) async_add_entities(devices) diff --git a/homeassistant/components/esphome/__init__.py b/homeassistant/components/esphome/__init__.py index 1c7d713d827..4710967a625 100644 --- a/homeassistant/components/esphome/__init__.py +++ b/homeassistant/components/esphome/__init__.py @@ -1,4 +1,9 @@ -"""Support for esphome devices.""" +""" +Support for esphome devices. + +For more details about this component, please refer to the documentation at +https://home-assistant.io/components/esphome/ +""" import asyncio import logging from typing import Any, Dict, List, Optional, TYPE_CHECKING, Callable @@ -30,9 +35,11 @@ if TYPE_CHECKING: from aioesphomeapi import APIClient, EntityInfo, EntityState, DeviceInfo, \ ServiceCall -DOMAIN = 'esphome' REQUIREMENTS = ['aioesphomeapi==1.5.0'] +_LOGGER = logging.getLogger(__name__) + +DOMAIN = 'esphome' DISPATCHER_UPDATE_ENTITY = 'esphome_{entry_id}_update_{component_key}_{key}' DISPATCHER_REMOVE_ENTITY = 'esphome_{entry_id}_remove_{component_key}_{key}' @@ -53,8 +60,6 @@ HA_COMPONENTS = [ 'switch', ] -_LOGGER = logging.getLogger(__name__) - # No config schema - only configuration entry CONFIG_SCHEMA = vol.Schema({}, extra=vol.ALLOW_EXTRA) diff --git a/homeassistant/components/eufy/__init__.py b/homeassistant/components/eufy/__init__.py index c1166f8cf7b..d5a0938bf66 100644 --- a/homeassistant/components/eufy/__init__.py +++ b/homeassistant/components/eufy/__init__.py @@ -1,20 +1,14 @@ -""" -Support for Eufy devices. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/eufy/ -""" +"""Support for Eufy devices.""" import logging import voluptuous as vol -from homeassistant.const import CONF_ACCESS_TOKEN, CONF_ADDRESS, \ - CONF_DEVICES, CONF_USERNAME, CONF_PASSWORD, CONF_TYPE, CONF_NAME +from homeassistant.const import ( + CONF_ACCESS_TOKEN, CONF_ADDRESS, CONF_DEVICES, CONF_NAME, CONF_PASSWORD, + CONF_TYPE, CONF_USERNAME) from homeassistant.helpers import discovery - import homeassistant.helpers.config_validation as cv - REQUIREMENTS = ['lakeside==0.11'] _LOGGER = logging.getLogger(__name__) @@ -30,8 +24,8 @@ DEVICE_SCHEMA = vol.Schema({ CONFIG_SCHEMA = vol.Schema({ DOMAIN: vol.Schema({ - vol.Optional(CONF_DEVICES, default=[]): vol.All(cv.ensure_list, - [DEVICE_SCHEMA]), + vol.Optional(CONF_DEVICES, default=[]): + vol.All(cv.ensure_list, [DEVICE_SCHEMA]), vol.Inclusive(CONF_USERNAME, 'authentication'): cv.string, vol.Inclusive(CONF_PASSWORD, 'authentication'): cv.string, }), diff --git a/homeassistant/components/eufy/light.py b/homeassistant/components/eufy/light.py index 7a44a58cd81..62bc058f155 100644 --- a/homeassistant/components/eufy/light.py +++ b/homeassistant/components/eufy/light.py @@ -1,9 +1,4 @@ -""" -Support for Eufy lights. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/light.eufy/ -""" +"""Support for Eufy lights.""" import logging from homeassistant.components.light import ( diff --git a/homeassistant/components/eufy/switch.py b/homeassistant/components/eufy/switch.py index a226797c0f8..96d68194107 100644 --- a/homeassistant/components/eufy/switch.py +++ b/homeassistant/components/eufy/switch.py @@ -1,9 +1,4 @@ -""" -Support for Eufy switches. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.eufy/ -""" +"""Support for Eufy switches.""" import logging from homeassistant.components.switch import SwitchDevice diff --git a/homeassistant/components/evohome/__init__.py b/homeassistant/components/evohome/__init__.py index 40ba5b9b70f..52bb77516e6 100644 --- a/homeassistant/components/evohome/__init__.py +++ b/homeassistant/components/evohome/__init__.py @@ -1,19 +1,10 @@ -"""Support for (EMEA/EU-based) Honeywell evohome systems. - -Support for a temperature control system (TCS, controller) with 0+ heating -zones (e.g. TRVs, relays) and, optionally, a DHW controller. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/evohome/ -""" - +"""Support for (EMEA/EU-based) Honeywell evohome systems.""" # Glossary: # TCS - temperature control system (a.k.a. Controller, Parent), which can # have up to 13 Children: # 0-12 Heating zones (a.k.a. Zone), and # 0-1 DHW controller, (a.k.a. Boiler) # The TCS & Zones are implemented as Climate devices, Boiler as a WaterHeater - from datetime import timedelta import logging @@ -46,8 +37,7 @@ CONFIG_SCHEMA = vol.Schema({ DOMAIN: vol.Schema({ vol.Required(CONF_USERNAME): cv.string, vol.Required(CONF_PASSWORD): cv.string, - vol.Optional(CONF_LOCATION_IDX, default=0): - cv.positive_int, + vol.Optional(CONF_LOCATION_IDX, default=0): cv.positive_int, vol.Optional(CONF_SCAN_INTERVAL, default=SCAN_INTERVAL_DEFAULT): vol.All(cv.time_period, vol.Range(min=SCAN_INTERVAL_MINIMUM)), }), @@ -109,9 +99,9 @@ def setup(hass, hass_config): ) else: - raise # we dont expect/handle any other HTTPErrors + raise # We don't expect/handle any other HTTPErrors - return False # unable to continue + return False finally: # Redact username, password as no longer needed evo_data['params'][CONF_USERNAME] = 'REDACTED' @@ -136,11 +126,8 @@ def setup(hass, hass_config): except IndexError: _LOGGER.warning( "setup(): Parameter '%s'=%s, is outside its range (0-%s)", - CONF_LOCATION_IDX, - loc_idx, - len(client.installation_info) - 1 - ) - return False # unable to continue + CONF_LOCATION_IDX, loc_idx, len(client.installation_info) - 1) + return False if _LOGGER.isEnabledFor(logging.DEBUG): tmp_loc = dict(evo_data['config']) @@ -154,7 +141,7 @@ def setup(hass, hass_config): @callback def _first_update(event): - # When HA has started, the hub knows to retreive it's first update + """When HA has started, the hub knows to retrieve it's first update.""" pkt = {'sender': 'setup()', 'signal': 'refresh', 'to': EVO_PARENT} async_dispatcher_send(hass, DISPATCHER_EVOHOME, pkt) diff --git a/homeassistant/components/evohome/climate.py b/homeassistant/components/evohome/climate.py index fd58e6c01e8..ef82a3dc81c 100644 --- a/homeassistant/components/evohome/climate.py +++ b/homeassistant/components/evohome/climate.py @@ -1,12 +1,4 @@ -"""Support for Climate devices of (EMEA/EU-based) Honeywell evohome systems. - -Support for a temperature control system (TCS, controller) with 0+ heating -zones (e.g. TRVs, relays). - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/climate.evohome/ -""" - +"""Support for Climate devices of (EMEA/EU-based) Honeywell evohome systems.""" from datetime import datetime, timedelta import logging @@ -40,7 +32,7 @@ from homeassistant.helpers.dispatcher import ( _LOGGER = logging.getLogger(__name__) -# the Controller's opmode/state and the zone's (inherited) state +# The Controller's opmode/state and the zone's (inherited) state EVO_RESET = 'AutoWithReset' EVO_AUTO = 'Auto' EVO_AUTOECO = 'AutoWithEco' @@ -49,12 +41,12 @@ EVO_DAYOFF = 'DayOff' EVO_CUSTOM = 'Custom' EVO_HEATOFF = 'HeatingOff' -# these are for Zones' opmode, and state +# These are for Zones' opmode, and state EVO_FOLLOW = 'FollowSchedule' EVO_TEMPOVER = 'TemporaryOverride' EVO_PERMOVER = 'PermanentOverride' -# for the Controller. NB: evohome treats Away mode as a mode in/of itself, +# For the Controller. NB: evohome treats Away mode as a mode in/of itself, # where HA considers it to 'override' the exising operating mode TCS_STATE_TO_HA = { EVO_RESET: STATE_AUTO, @@ -100,16 +92,12 @@ async def async_setup_platform(hass, hass_config, async_add_entities, # evohomeclient has exposed no means of accessing non-default location # (i.e. loc_idx > 0) other than using a protected member, such as below - tcs_obj_ref = client.locations[loc_idx]._gateways[0]._control_systems[0] # noqa E501; pylint: disable=protected-access + tcs_obj_ref = client.locations[loc_idx]._gateways[0]._control_systems[0] # noqa E501; pylint: disable=protected-access _LOGGER.debug( - "setup_platform(): Found Controller, id=%s [%s], " - "name=%s (location_idx=%s)", - tcs_obj_ref.systemId, - tcs_obj_ref.modelType, - tcs_obj_ref.location.name, - loc_idx - ) + "Found Controller, id=%s [%s], name=%s (location_idx=%s)", + tcs_obj_ref.systemId, tcs_obj_ref.modelType, tcs_obj_ref.location.name, + loc_idx) controller = EvoController(evo_data, client, tcs_obj_ref) zones = [] @@ -117,12 +105,8 @@ async def async_setup_platform(hass, hass_config, async_add_entities, for zone_idx in tcs_obj_ref.zones: zone_obj_ref = tcs_obj_ref.zones[zone_idx] _LOGGER.debug( - "setup_platform(): Found Zone, id=%s [%s], " - "name=%s", - zone_obj_ref.zoneId, - zone_obj_ref.zone_type, - zone_obj_ref.name - ) + "Found Zone, id=%s [%s], name=%s", + zone_obj_ref.zoneId, zone_obj_ref.zone_type, zone_obj_ref.name) zones.append(EvoZone(evo_data, client, zone_obj_ref)) entities = [controller] + zones @@ -164,12 +148,9 @@ class EvoClimateDevice(ClimateDevice): _LOGGER.warning( "API rate limit has been exceeded. Suspending polling for %s " - "seconds, and increasing '%s' from %s to %s seconds.", - new_interval * 3, - CONF_SCAN_INTERVAL, - old_interval, - new_interval, - ) + "seconds, and increasing '%s' from %s to %s seconds", + new_interval * 3, CONF_SCAN_INTERVAL, old_interval, + new_interval) self._timers['statusUpdated'] = datetime.now() + new_interval * 3 @@ -316,7 +297,7 @@ class EvoZone(EvoClimateDevice): try: self._obj.set_temperature(temperature, until) except HTTPError as err: - self._handle_exception("HTTPError", str(err)) # noqa: E501; pylint: disable=no-member + self._handle_exception("HTTPError", str(err)) # noqa: E501; pylint: disable=no-member def set_temperature(self, **kwargs): """Set new target temperature, indefinitely.""" @@ -366,7 +347,7 @@ class EvoZone(EvoClimateDevice): try: self._obj.cancel_temp_override(self._obj) except HTTPError as err: - self._handle_exception("HTTPError", str(err)) # noqa: E501; pylint: disable=no-member + self._handle_exception("HTTPError", str(err)) # noqa: E501; pylint: disable=no-member elif operation_mode == EVO_TEMPOVER: _LOGGER.error( @@ -526,7 +507,7 @@ class EvoController(EvoClimateDevice): def _set_operation_mode(self, operation_mode): try: - self._obj._set_status(operation_mode) # noqa: E501; pylint: disable=protected-access + self._obj._set_status(operation_mode) # noqa: E501; pylint: disable=protected-access except HTTPError as err: self._handle_requests_exceptions(err) @@ -558,7 +539,7 @@ class EvoController(EvoClimateDevice): if not expired: return - # Retreive the latest state data via the client api + # Retrieve the latest state data via the client API loc_idx = self._params[CONF_LOCATION_IDX] try: @@ -570,10 +551,7 @@ class EvoController(EvoClimateDevice): self._timers['statusUpdated'] = datetime.now() self._available = True - _LOGGER.debug( - "_update_state_data(): self._status = %s", - self._status - ) + _LOGGER.debug("Status = %s", self._status) # inform the child devices that state data has been updated pkt = {'sender': 'controller', 'signal': 'refresh', 'to': EVO_CHILD} diff --git a/homeassistant/components/fastdotcom/__init__.py b/homeassistant/components/fastdotcom/__init__.py index aef8e4c48f9..a63fab76861 100644 --- a/homeassistant/components/fastdotcom/__init__.py +++ b/homeassistant/components/fastdotcom/__init__.py @@ -1,10 +1,4 @@ -""" -Support for testing internet speed via Fast.com. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/fastdotcom/ -""" - +"""Support for testing internet speed via Fast.com.""" import logging from datetime import timedelta diff --git a/homeassistant/components/fastdotcom/sensor.py b/homeassistant/components/fastdotcom/sensor.py index 4d105cebf44..0f17179f918 100644 --- a/homeassistant/components/fastdotcom/sensor.py +++ b/homeassistant/components/fastdotcom/sensor.py @@ -1,9 +1,4 @@ -""" -Support for Fast.com internet speed testing sensor. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.fastdotcom/ -""" +"""Support for Fast.com internet speed testing sensor.""" import logging from homeassistant.components.fastdotcom import DOMAIN as FASTDOTCOM_DOMAIN, \ diff --git a/homeassistant/components/feedreader/__init__.py b/homeassistant/components/feedreader/__init__.py index f6d653360a9..86744bfd39c 100644 --- a/homeassistant/components/feedreader/__init__.py +++ b/homeassistant/components/feedreader/__init__.py @@ -1,9 +1,4 @@ -""" -Support for RSS/Atom feeds. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/feedreader/ -""" +"""Support for RSS/Atom feeds.""" from datetime import datetime, timedelta from logging import getLogger from os.path import exists diff --git a/homeassistant/components/ffmpeg/__init__.py b/homeassistant/components/ffmpeg/__init__.py index 3184b5a5d54..7b7e3a81294 100644 --- a/homeassistant/components/ffmpeg/__init__.py +++ b/homeassistant/components/ffmpeg/__init__.py @@ -1,9 +1,4 @@ -""" -Component that will help set the FFmpeg component. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/ffmpeg/ -""" +"""Support for FFmpeg.""" import logging import re diff --git a/homeassistant/components/fibaro/__init__.py b/homeassistant/components/fibaro/__init__.py index 715cc036265..9a6ccccb5e3 100644 --- a/homeassistant/components/fibaro/__init__.py +++ b/homeassistant/components/fibaro/__init__.py @@ -1,10 +1,4 @@ -""" -Support for the Fibaro devices. - -For more details about this platform, please refer to the documentation. -https://home-assistant.io/components/fibaro/ -""" - +"""Support for the Fibaro devices.""" import logging from collections import defaultdict from typing import Optional @@ -22,20 +16,30 @@ from homeassistant.util import convert, slugify REQUIREMENTS = ['fiblary3==0.1.7'] _LOGGER = logging.getLogger(__name__) -DOMAIN = 'fibaro' -FIBARO_DEVICES = 'fibaro_devices' -FIBARO_CONTROLLERS = 'fibaro_controllers' -ATTR_CURRENT_POWER_W = "current_power_w" -ATTR_CURRENT_ENERGY_KWH = "current_energy_kwh" -CONF_PLUGINS = "plugins" -CONF_GATEWAYS = 'gateways' -CONF_DIMMING = "dimming" -CONF_COLOR = "color" -CONF_RESET_COLOR = "reset_color" -CONF_DEVICE_CONFIG = "device_config" -FIBARO_COMPONENTS = ['binary_sensor', 'cover', 'light', - 'scene', 'sensor', 'switch'] +ATTR_CURRENT_ENERGY_KWH = 'current_energy_kwh' +ATTR_CURRENT_POWER_W = 'current_power_w' + +CONF_COLOR = 'color' +CONF_DEVICE_CONFIG = 'device_config' +CONF_DIMMING = 'dimming' +CONF_GATEWAYS = 'gateways' +CONF_PLUGINS = 'plugins' +CONF_RESET_COLOR = 'reset_color' + +DOMAIN = 'fibaro' + +FIBARO_CONTROLLERS = 'fibaro_controllers' +FIBARO_DEVICES = 'fibaro_devices' + +FIBARO_COMPONENTS = [ + 'binary_sensor', + 'cover', + 'light', + 'scene', + 'sensor', + 'switch', +] FIBARO_TYPEMAP = { 'com.fibaro.multilevelSensor': "sensor", @@ -78,8 +82,7 @@ GATEWAY_CONFIG = vol.Schema({ CONFIG_SCHEMA = vol.Schema({ DOMAIN: vol.Schema({ - vol.Required(CONF_GATEWAYS): - vol.All(cv.ensure_list, [GATEWAY_CONFIG]) + vol.Required(CONF_GATEWAYS): vol.All(cv.ensure_list, [GATEWAY_CONFIG]), }) }, extra=vol.ALLOW_EXTRA) @@ -91,20 +94,19 @@ class FibaroController(): """Initialize the Fibaro controller.""" from fiblary3.client.v4.client import Client as FibaroClient - self._client = FibaroClient(config[CONF_URL], - config[CONF_USERNAME], - config[CONF_PASSWORD]) + self._client = FibaroClient( + config[CONF_URL], config[CONF_USERNAME], config[CONF_PASSWORD]) self._scene_map = None # Whether to import devices from plugins self._import_plugins = config[CONF_PLUGINS] self._device_config = config[CONF_DEVICE_CONFIG] - self._room_map = None # Mapping roomId to room object - self._device_map = None # Mapping deviceId to device object - self.fibaro_devices = None # List of devices by type - self._callbacks = {} # Update value callbacks by deviceId - self._state_handler = None # Fiblary's StateHandler object + self._room_map = None # Mapping roomId to room object + self._device_map = None # Mapping deviceId to device object + self.fibaro_devices = None # List of devices by type + self._callbacks = {} # Update value callbacks by deviceId + self._state_handler = None # Fiblary's StateHandler object self._excluded_devices = config[CONF_EXCLUDE] - self.hub_serial = None # Unique serial number of the hub + self.hub_serial = None # Unique serial number of the hub def connect(self): """Start the communication with the Fibaro controller.""" @@ -118,7 +120,7 @@ class FibaroController(): return False if login is None or login.status is False: _LOGGER.error("Invalid login for Fibaro HC. " - "Please check username and password.") + "Please check username and password") return False self._room_map = {room.id: room for room in self._client.rooms.list()} diff --git a/homeassistant/components/fibaro/binary_sensor.py b/homeassistant/components/fibaro/binary_sensor.py index 1934580c58e..2c2d9c30a79 100644 --- a/homeassistant/components/fibaro/binary_sensor.py +++ b/homeassistant/components/fibaro/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for Fibaro binary sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.fibaro/ -""" +"""Support for Fibaro binary sensors.""" import logging from homeassistant.components.binary_sensor import ( diff --git a/homeassistant/components/fibaro/cover.py b/homeassistant/components/fibaro/cover.py index d47dbb20315..aa34fcc36a9 100644 --- a/homeassistant/components/fibaro/cover.py +++ b/homeassistant/components/fibaro/cover.py @@ -1,9 +1,4 @@ -""" -Support for Fibaro cover - curtains, rollershutters etc. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/cover.fibaro/ -""" +"""Support for Fibaro cover - curtains, rollershutters etc.""" import logging from homeassistant.components.cover import ( diff --git a/homeassistant/components/fibaro/light.py b/homeassistant/components/fibaro/light.py index 9b3b3850f39..5ee3e83b95f 100644 --- a/homeassistant/components/fibaro/light.py +++ b/homeassistant/components/fibaro/light.py @@ -1,10 +1,4 @@ -""" -Support for Fibaro lights. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/light.fibaro/ -""" - +"""Support for Fibaro lights.""" import logging import asyncio from functools import partial diff --git a/homeassistant/components/fibaro/scene.py b/homeassistant/components/fibaro/scene.py index a0bd4e7ff40..620f095b733 100644 --- a/homeassistant/components/fibaro/scene.py +++ b/homeassistant/components/fibaro/scene.py @@ -1,9 +1,4 @@ -""" -Support for Fibaro scenes. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/scene.fibaro/ -""" +"""Support for Fibaro scenes.""" import logging from homeassistant.components.scene import ( diff --git a/homeassistant/components/fibaro/sensor.py b/homeassistant/components/fibaro/sensor.py index e437ef8710d..01452d8b394 100644 --- a/homeassistant/components/fibaro/sensor.py +++ b/homeassistant/components/fibaro/sensor.py @@ -1,9 +1,4 @@ -""" -Support for Fibaro sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.fibaro/ -""" +"""Support for Fibaro sensors.""" import logging from homeassistant.const import ( diff --git a/homeassistant/components/fibaro/switch.py b/homeassistant/components/fibaro/switch.py index 8b59aabec72..04b8aba1cf4 100644 --- a/homeassistant/components/fibaro/switch.py +++ b/homeassistant/components/fibaro/switch.py @@ -1,9 +1,4 @@ -""" -Support for Fibaro switches. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.fibaro/ -""" +"""Support for Fibaro switches.""" import logging from homeassistant.util import convert diff --git a/homeassistant/components/folder_watcher/__init__.py b/homeassistant/components/folder_watcher/__init__.py index 098b34ac948..babfbd9e9aa 100644 --- a/homeassistant/components/folder_watcher/__init__.py +++ b/homeassistant/components/folder_watcher/__init__.py @@ -1,17 +1,15 @@ -""" -Component for monitoring activity on a folder. - -For more details about this platform, refer to the documentation at -https://home-assistant.io/components/folder_watcher/ -""" -import os +"""Component for monitoring activity on a folder.""" import logging +import os + import voluptuous as vol + from homeassistant.const import ( EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP) import homeassistant.helpers.config_validation as cv REQUIREMENTS = ['watchdog==0.8.3'] + _LOGGER = logging.getLogger(__name__) CONF_FOLDER = 'folder' diff --git a/homeassistant/components/foursquare/__init__.py b/homeassistant/components/foursquare/__init__.py index a4a7395adc4..0c5a48049ec 100644 --- a/homeassistant/components/foursquare/__init__.py +++ b/homeassistant/components/foursquare/__init__.py @@ -1,9 +1,4 @@ -""" -Support for the Foursquare (Swarm) API. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/foursquare/ -""" +"""Support for the Foursquare (Swarm) API.""" import logging import requests diff --git a/homeassistant/components/freebox/__init__.py b/homeassistant/components/freebox/__init__.py index 99efbae0984..41e60d884ce 100644 --- a/homeassistant/components/freebox/__init__.py +++ b/homeassistant/components/freebox/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Freebox devices (Freebox v6 and Freebox mini 4K). - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/freebox/ -""" +"""Support for Freebox devices (Freebox v6 and Freebox mini 4K).""" import logging import socket @@ -26,7 +21,7 @@ FREEBOX_CONFIG_FILE = 'freebox.conf' CONFIG_SCHEMA = vol.Schema({ DOMAIN: vol.Schema({ vol.Required(CONF_HOST): cv.string, - vol.Required(CONF_PORT): cv.port + vol.Required(CONF_PORT): cv.port, }) }, extra=vol.ALLOW_EXTRA) diff --git a/homeassistant/components/freebox/device_tracker.py b/homeassistant/components/freebox/device_tracker.py index f4e1ce5bd8a..fb94f7f56f5 100644 --- a/homeassistant/components/freebox/device_tracker.py +++ b/homeassistant/components/freebox/device_tracker.py @@ -1,9 +1,4 @@ -""" -Support for Freebox devices (Freebox v6 and Freebox mini 4K). - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/device_tracker.freebox/ -""" +"""Support for Freebox devices (Freebox v6 and Freebox mini 4K).""" from collections import namedtuple import logging diff --git a/homeassistant/components/freebox/sensor.py b/homeassistant/components/freebox/sensor.py index 2f8ccbc745d..49e68dc2c41 100644 --- a/homeassistant/components/freebox/sensor.py +++ b/homeassistant/components/freebox/sensor.py @@ -1,9 +1,4 @@ -""" -Support for Freebox devices (Freebox v6 and Freebox mini 4K). - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/sensor.freebox/ -""" +"""Support for Freebox devices (Freebox v6 and Freebox mini 4K).""" import logging from homeassistant.components.freebox import DATA_FREEBOX @@ -18,10 +13,7 @@ async def async_setup_platform( hass, config, async_add_entities, discovery_info=None): """Set up the sensors.""" fbx = hass.data[DATA_FREEBOX] - async_add_entities([ - FbxRXSensor(fbx), - FbxTXSensor(fbx) - ], True) + async_add_entities([FbxRXSensor(fbx), FbxTXSensor(fbx)], True) class FbxSensor(Entity): diff --git a/homeassistant/components/fritzbox/__init__.py b/homeassistant/components/fritzbox/__init__.py index ad3c7bc1929..81ba019acbc 100644 --- a/homeassistant/components/fritzbox/__init__.py +++ b/homeassistant/components/fritzbox/__init__.py @@ -1,9 +1,4 @@ -""" -Support for AVM Fritz!Box smarthome devices. - -For more details about this component, please refer to the documentation at -http://home-assistant.io/components/fritzbox/ -""" +"""Support for AVM Fritz!Box smarthome devices.""" import logging import voluptuous as vol diff --git a/homeassistant/components/fritzbox/binary_sensor.py b/homeassistant/components/fritzbox/binary_sensor.py index ab58e6e84bc..c68c79f1e77 100644 --- a/homeassistant/components/fritzbox/binary_sensor.py +++ b/homeassistant/components/fritzbox/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for Fritzbox binary sensors. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.fritzbox/ -""" +"""Support for Fritzbox binary sensors.""" import logging import requests diff --git a/homeassistant/components/fritzbox/climate.py b/homeassistant/components/fritzbox/climate.py index f2d13ee92f6..64d99ebf133 100644 --- a/homeassistant/components/fritzbox/climate.py +++ b/homeassistant/components/fritzbox/climate.py @@ -1,9 +1,4 @@ -""" -Support for AVM Fritz!Box smarthome thermostate devices. - -For more details about this component, please refer to the documentation at -http://home-assistant.io/components/climate.fritzbox/ -""" +"""Support for AVM Fritz!Box smarthome thermostate devices.""" import logging import requests @@ -19,6 +14,7 @@ from homeassistant.components.climate import ( SUPPORT_TARGET_TEMPERATURE) from homeassistant.const import ( ATTR_BATTERY_LEVEL, ATTR_TEMPERATURE, PRECISION_HALVES, TEMP_CELSIUS) + DEPENDENCIES = ['fritzbox'] _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/fritzbox/sensor.py b/homeassistant/components/fritzbox/sensor.py index 66c515c2bfd..a1736fb9857 100644 --- a/homeassistant/components/fritzbox/sensor.py +++ b/homeassistant/components/fritzbox/sensor.py @@ -1,9 +1,4 @@ -""" -Support for AVM Fritz!Box smarthome temperature sensor only devices. - -For more details about this component, please refer to the documentation at -http://home-assistant.io/components/sensor.fritzbox/ -""" +"""Support for AVM Fritz!Box smarthome temperature sensor only devices.""" import logging import requests diff --git a/homeassistant/components/fritzbox/switch.py b/homeassistant/components/fritzbox/switch.py index 55fa8a04796..be9212793ab 100644 --- a/homeassistant/components/fritzbox/switch.py +++ b/homeassistant/components/fritzbox/switch.py @@ -1,9 +1,4 @@ -""" -Support for AVM Fritz!Box smarthome switch devices. - -For more details about this component, please refer to the documentation at -http://home-assistant.io/components/switch.fritzbox/ -""" +"""Support for AVM Fritz!Box smarthome switch devices.""" import logging import requests diff --git a/homeassistant/components/frontend/__init__.py b/homeassistant/components/frontend/__init__.py index f89596c0c02..bf4df366ae3 100644 --- a/homeassistant/components/frontend/__init__.py +++ b/homeassistant/components/frontend/__init__.py @@ -1,9 +1,4 @@ -""" -Handle the frontend for Home Assistant. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/frontend/ -""" +"""Handle the frontend for Home Assistant.""" import asyncio import json import logging diff --git a/homeassistant/components/gc100/__init__.py b/homeassistant/components/gc100/__init__.py index 0d4b19da030..36e9c61b1ba 100644 --- a/homeassistant/components/gc100/__init__.py +++ b/homeassistant/components/gc100/__init__.py @@ -1,9 +1,4 @@ -""" -Support for controlling Global Cache gc100. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/gc100/ -""" +"""Support for controlling Global Cache gc100.""" import logging import voluptuous as vol diff --git a/homeassistant/components/rainmachine/__init__.py b/homeassistant/components/rainmachine/__init__.py index 4eb9e390d71..0591af8acfa 100644 --- a/homeassistant/components/rainmachine/__init__.py +++ b/homeassistant/components/rainmachine/__init__.py @@ -1,9 +1,4 @@ -""" -Support for RainMachine devices. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/rainmachine/ -""" +"""Support for RainMachine devices.""" import logging from datetime import timedelta diff --git a/homeassistant/components/raspihats/__init__.py b/homeassistant/components/raspihats/__init__.py index 5e834cdf7ec..69b03a36769 100644 --- a/homeassistant/components/raspihats/__init__.py +++ b/homeassistant/components/raspihats/__init__.py @@ -1,9 +1,4 @@ -""" -Support for controlling raspihats boards. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/raspihats/ -""" +"""Support for controlling raspihats boards.""" import logging import threading import time diff --git a/homeassistant/components/raspihats/binary_sensor.py b/homeassistant/components/raspihats/binary_sensor.py index feef5396d88..04885402e72 100644 --- a/homeassistant/components/raspihats/binary_sensor.py +++ b/homeassistant/components/raspihats/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Configure a binary_sensor using a digital input from a raspihats board. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.raspihats/ -""" +"""Support for raspihats board binary sensors.""" import logging import voluptuous as vol @@ -34,7 +29,7 @@ _CHANNELS_SCHEMA = vol.Schema([{ _I2C_HATS_SCHEMA = vol.Schema([{ vol.Required(CONF_BOARD): vol.In(I2C_HAT_NAMES), vol.Required(CONF_ADDRESS): vol.Coerce(int), - vol.Required(CONF_CHANNELS): _CHANNELS_SCHEMA + vol.Required(CONF_CHANNELS): _CHANNELS_SCHEMA, }]) PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ diff --git a/homeassistant/components/raspihats/switch.py b/homeassistant/components/raspihats/switch.py index b422efea2ff..10bb2f748c4 100644 --- a/homeassistant/components/raspihats/switch.py +++ b/homeassistant/components/raspihats/switch.py @@ -1,9 +1,4 @@ -""" -Configure a switch using a digital output from a raspihats board. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.raspihats/ -""" +"""Support for raspihats board switches.""" import logging import voluptuous as vol diff --git a/homeassistant/components/recorder/__init__.py b/homeassistant/components/recorder/__init__.py index cafae2b0b08..9b852b4a00a 100644 --- a/homeassistant/components/recorder/__init__.py +++ b/homeassistant/components/recorder/__init__.py @@ -1,12 +1,4 @@ -""" -Support for recording details. - -Component that records all events and state changes. Allows other components -to query this database. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/recorder/ -""" +"""Support for recording details.""" import asyncio from collections import namedtuple import concurrent.futures diff --git a/homeassistant/components/remember_the_milk/__init__.py b/homeassistant/components/remember_the_milk/__init__.py index a94e8e95c6f..82619e35a0e 100644 --- a/homeassistant/components/remember_the_milk/__init__.py +++ b/homeassistant/components/remember_the_milk/__init__.py @@ -1,9 +1,4 @@ -""" -Component to interact with Remember The Milk. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/remember_the_milk/ -""" +"""Support to interact with Remember The Milk.""" import json import logging import os diff --git a/homeassistant/components/remote/__init__.py b/homeassistant/components/remote/__init__.py index e04b0ef2758..b7923596039 100644 --- a/homeassistant/components/remote/__init__.py +++ b/homeassistant/components/remote/__init__.py @@ -1,9 +1,4 @@ -""" -Component to interface with universal remote control devices. - -For more details about this component, please refer to the documentation -at https://home-assistant.io/components/remote/ -""" +"""Support to interface with universal remote control devices.""" from datetime import timedelta import functools as ft import logging diff --git a/homeassistant/components/rest_command/__init__.py b/homeassistant/components/rest_command/__init__.py index c1ccc73b81c..01c5d837ca9 100644 --- a/homeassistant/components/rest_command/__init__.py +++ b/homeassistant/components/rest_command/__init__.py @@ -1,9 +1,4 @@ -""" -Exposes regular rest commands as services. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/rest_command/ -""" +"""Support for exposing regular REST commands as services.""" import asyncio import logging diff --git a/homeassistant/components/rflink/__init__.py b/homeassistant/components/rflink/__init__.py index ce9777151cf..98e80580fea 100644 --- a/homeassistant/components/rflink/__init__.py +++ b/homeassistant/components/rflink/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Rflink components. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/rflink/ -""" +"""Support for Rflink devices.""" import asyncio from collections import defaultdict import logging diff --git a/homeassistant/components/rfxtrx/__init__.py b/homeassistant/components/rfxtrx/__init__.py index f2c82842bc1..a7b703ef2ab 100644 --- a/homeassistant/components/rfxtrx/__init__.py +++ b/homeassistant/components/rfxtrx/__init__.py @@ -1,9 +1,4 @@ -""" -Support for RFXtrx components. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/rfxtrx/ -""" +"""Support for RFXtrx devices.""" from collections import OrderedDict import logging diff --git a/homeassistant/components/rfxtrx/binary_sensor.py b/homeassistant/components/rfxtrx/binary_sensor.py index 1e88c72e19d..9a49bd02b97 100644 --- a/homeassistant/components/rfxtrx/binary_sensor.py +++ b/homeassistant/components/rfxtrx/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for RFXtrx binary sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.rfxtrx/ -""" +"""Support for RFXtrx binary sensors.""" import logging import voluptuous as vol @@ -35,7 +30,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ vol.Any(cv.time_period, cv.positive_timedelta), vol.Optional(CONF_DATA_BITS): cv.positive_int, vol.Optional(CONF_COMMAND_ON): cv.byte, - vol.Optional(CONF_COMMAND_OFF): cv.byte + vol.Optional(CONF_COMMAND_OFF): cv.byte, }) }, vol.Optional(CONF_AUTOMATIC_ADD, default=False): cv.boolean, diff --git a/homeassistant/components/rfxtrx/cover.py b/homeassistant/components/rfxtrx/cover.py index d486b601977..5a657923683 100644 --- a/homeassistant/components/rfxtrx/cover.py +++ b/homeassistant/components/rfxtrx/cover.py @@ -1,9 +1,4 @@ -""" -Support for RFXtrx cover components. - -For more details about this platform, please refer to the documentation -https://home-assistant.io/components/cover.rfxtrx/ -""" +"""Support for RFXtrx covers.""" import voluptuous as vol from homeassistant.components import rfxtrx diff --git a/homeassistant/components/rfxtrx/light.py b/homeassistant/components/rfxtrx/light.py index 10288773486..d0b75c2f962 100644 --- a/homeassistant/components/rfxtrx/light.py +++ b/homeassistant/components/rfxtrx/light.py @@ -1,9 +1,4 @@ -""" -Support for RFXtrx lights. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/light.rfxtrx/ -""" +"""Support for RFXtrx lights.""" import logging import voluptuous as vol diff --git a/homeassistant/components/rfxtrx/sensor.py b/homeassistant/components/rfxtrx/sensor.py index c2eff8d7c5d..74c64635563 100644 --- a/homeassistant/components/rfxtrx/sensor.py +++ b/homeassistant/components/rfxtrx/sensor.py @@ -1,9 +1,4 @@ -""" -Support for RFXtrx sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.rfxtrx/ -""" +"""Support for RFXtrx sensors.""" import logging import voluptuous as vol diff --git a/homeassistant/components/rfxtrx/switch.py b/homeassistant/components/rfxtrx/switch.py index c0f057da138..141cf2c2c1a 100644 --- a/homeassistant/components/rfxtrx/switch.py +++ b/homeassistant/components/rfxtrx/switch.py @@ -1,9 +1,4 @@ -""" -Support for RFXtrx switches. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.rfxtrx/ -""" +"""Support for RFXtrx switches.""" import logging import voluptuous as vol diff --git a/homeassistant/components/ring/__init__.py b/homeassistant/components/ring/__init__.py index 2e048caa52f..526388a0918 100644 --- a/homeassistant/components/ring/__init__.py +++ b/homeassistant/components/ring/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Ring Doorbell/Chimes. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/ring/ -""" +"""Support for Ring Doorbell/Chimes.""" import logging from requests.exceptions import HTTPError, ConnectTimeout diff --git a/homeassistant/components/roku/__init__.py b/homeassistant/components/roku/__init__.py index 5ceebb3dee5..89bb1a9acb8 100644 --- a/homeassistant/components/roku/__init__.py +++ b/homeassistant/components/roku/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Roku platform. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/roku/ -""" +"""Support for Roku.""" import logging import voluptuous as vol diff --git a/homeassistant/components/roku/media_player.py b/homeassistant/components/roku/media_player.py index 7d1977aadc1..3cf27af0674 100644 --- a/homeassistant/components/roku/media_player.py +++ b/homeassistant/components/roku/media_player.py @@ -1,9 +1,4 @@ -""" -Support for the Roku media player. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/media_player.roku/ -""" +"""Support for the Roku media player.""" import logging import requests.exceptions diff --git a/homeassistant/components/roku/remote.py b/homeassistant/components/roku/remote.py index 86a7105dafe..5529918010c 100644 --- a/homeassistant/components/roku/remote.py +++ b/homeassistant/components/roku/remote.py @@ -1,20 +1,14 @@ -""" -Support for the Roku remote. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/remote.roku/ -""" +"""Support for the Roku remote.""" import requests.exceptions from homeassistant.components import remote from homeassistant.const import (CONF_HOST) - DEPENDENCIES = ['roku'] -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up the Roku remote platform.""" if not discovery_info: return diff --git a/homeassistant/components/route53/__init__.py b/homeassistant/components/route53/__init__.py index 4c35983feed..725dec8b8e5 100644 --- a/homeassistant/components/route53/__init__.py +++ b/homeassistant/components/route53/__init__.py @@ -1,9 +1,4 @@ -""" -Update the IP addresses of your Route53 DNS records. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/route53/ -""" +"""Update the IP addresses of your Route53 DNS records.""" from datetime import timedelta import logging from typing import List diff --git a/homeassistant/components/rpi_gpio/__init__.py b/homeassistant/components/rpi_gpio/__init__.py index 5f52341f1cb..b5bd0796f16 100644 --- a/homeassistant/components/rpi_gpio/__init__.py +++ b/homeassistant/components/rpi_gpio/__init__.py @@ -1,9 +1,4 @@ -""" -Support for controlling GPIO pins of a Raspberry Pi. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/rpi_gpio/ -""" +"""Support for controlling GPIO pins of a Raspberry Pi.""" import logging from homeassistant.const import ( diff --git a/homeassistant/components/rpi_gpio/binary_sensor.py b/homeassistant/components/rpi_gpio/binary_sensor.py index 2fe4e0766ed..559ae958404 100644 --- a/homeassistant/components/rpi_gpio/binary_sensor.py +++ b/homeassistant/components/rpi_gpio/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for binary sensor using RPi GPIO. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.rpi_gpio/ -""" +"""Support for binary sensor using RPi GPIO.""" import logging import voluptuous as vol diff --git a/homeassistant/components/rpi_gpio/cover.py b/homeassistant/components/rpi_gpio/cover.py index 828f5e8e0fe..403f7ec6867 100644 --- a/homeassistant/components/rpi_gpio/cover.py +++ b/homeassistant/components/rpi_gpio/cover.py @@ -1,12 +1,4 @@ -""" -Support for controlling a Raspberry Pi cover. - -Instructions for building the controller can be found here -https://github.com/andrewshilliday/garage-door-controller - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/cover.rpi_gpio/ -""" +"""Support for controlling a Raspberry Pi cover.""" import logging from time import sleep diff --git a/homeassistant/components/rpi_gpio/switch.py b/homeassistant/components/rpi_gpio/switch.py index 3dec1135ec8..bdb79d03eec 100644 --- a/homeassistant/components/rpi_gpio/switch.py +++ b/homeassistant/components/rpi_gpio/switch.py @@ -1,9 +1,4 @@ -""" -Allows to configure a switch using RPi GPIO. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.rpi_gpio/ -""" +"""Allows to configure a switch using RPi GPIO.""" import logging import voluptuous as vol diff --git a/homeassistant/components/rpi_pfio/__init__.py b/homeassistant/components/rpi_pfio/__init__.py index 286be87bce9..b096d9fe98a 100644 --- a/homeassistant/components/rpi_pfio/__init__.py +++ b/homeassistant/components/rpi_pfio/__init__.py @@ -1,9 +1,4 @@ -""" -Support for controlling the PiFace Digital I/O module on a RPi. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/rpi_pfio/ -""" +"""Support for controlling the PiFace Digital I/O module on a RPi.""" import logging from homeassistant.const import ( diff --git a/homeassistant/components/rpi_pfio/binary_sensor.py b/homeassistant/components/rpi_pfio/binary_sensor.py index 61d1f8ac285..677ec3bb16f 100644 --- a/homeassistant/components/rpi_pfio/binary_sensor.py +++ b/homeassistant/components/rpi_pfio/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for binary sensor using the PiFace Digital I/O module on a RPi. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.rpi_pfio/ -""" +"""Support for binary sensor using the PiFace Digital I/O module on a RPi.""" import logging import voluptuous as vol diff --git a/homeassistant/components/rpi_pfio/switch.py b/homeassistant/components/rpi_pfio/switch.py index 8b0871ca800..fc158bd666f 100644 --- a/homeassistant/components/rpi_pfio/switch.py +++ b/homeassistant/components/rpi_pfio/switch.py @@ -1,9 +1,4 @@ -""" -Allows to configure a switch using the PiFace Digital I/O module on a RPi. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.rpi_pfio/ -""" +"""Support for switches using the PiFace Digital I/O module on a RPi.""" import logging import voluptuous as vol diff --git a/homeassistant/components/rss_feed_template/__init__.py b/homeassistant/components/rss_feed_template/__init__.py index 34bee1ec5fc..3c93fe2ac83 100644 --- a/homeassistant/components/rss_feed_template/__init__.py +++ b/homeassistant/components/rss_feed_template/__init__.py @@ -1,10 +1,4 @@ -""" -Exports sensor values via RSS feed. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/rss_feed_template/ -""" - +"""Support to export sensor values via RSS feed.""" from html import escape from aiohttp import web diff --git a/homeassistant/components/sabnzbd/__init__.py b/homeassistant/components/sabnzbd/__init__.py index 25fce22c641..d070872f85c 100644 --- a/homeassistant/components/sabnzbd/__init__.py +++ b/homeassistant/components/sabnzbd/__init__.py @@ -1,9 +1,4 @@ -""" -Support for monitoring an SABnzbd NZB client. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sabnzbd/ -""" +"""Support for monitoring an SABnzbd NZB client.""" import logging from datetime import timedelta diff --git a/homeassistant/components/sabnzbd/sensor.py b/homeassistant/components/sabnzbd/sensor.py index 7e94f9026a8..ca8fc64eea4 100644 --- a/homeassistant/components/sabnzbd/sensor.py +++ b/homeassistant/components/sabnzbd/sensor.py @@ -1,9 +1,4 @@ -""" -Support for monitoring an SABnzbd NZB client. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.sabnzbd/ -""" +"""Support for monitoring an SABnzbd NZB client.""" import logging from homeassistant.components.sabnzbd import DATA_SABNZBD, \ @@ -16,8 +11,8 @@ DEPENDENCIES = ['sabnzbd'] _LOGGER = logging.getLogger(__name__) -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up the SABnzbd sensors.""" if discovery_info is None: return @@ -44,8 +39,8 @@ class SabnzbdSensor(Entity): async def async_added_to_hass(self): """Call when entity about to be added to hass.""" - async_dispatcher_connect(self.hass, SIGNAL_SABNZBD_UPDATED, - self.update_state) + async_dispatcher_connect( + self.hass, SIGNAL_SABNZBD_UPDATED, self.update_state) @property def name(self): diff --git a/homeassistant/components/satel_integra/__init__.py b/homeassistant/components/satel_integra/__init__.py index 25295c6f2ce..bff365a079f 100644 --- a/homeassistant/components/satel_integra/__init__.py +++ b/homeassistant/components/satel_integra/__init__.py @@ -1,10 +1,4 @@ -""" -Support for Satel Integra devices. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/satel_integra/ -""" - +"""Support for Satel Integra devices.""" import asyncio import logging diff --git a/homeassistant/components/satel_integra/alarm_control_panel.py b/homeassistant/components/satel_integra/alarm_control_panel.py index b704677800f..360acdb2497 100644 --- a/homeassistant/components/satel_integra/alarm_control_panel.py +++ b/homeassistant/components/satel_integra/alarm_control_panel.py @@ -1,9 +1,4 @@ -""" -Support for Satel Integra alarm, using ETHM module: https://www.satel.pl/en/ . - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/alarm_control_panel.satel_integra/ -""" +"""Support for Satel Integra alarm, using ETHM module.""" import logging import homeassistant.components.alarm_control_panel as alarm @@ -17,8 +12,8 @@ _LOGGER = logging.getLogger(__name__) DEPENDENCIES = ['satel_integra'] -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up for Satel Integra alarm panels.""" if not discovery_info: return diff --git a/homeassistant/components/satel_integra/binary_sensor.py b/homeassistant/components/satel_integra/binary_sensor.py index b4541cf2c44..34ced628712 100644 --- a/homeassistant/components/satel_integra/binary_sensor.py +++ b/homeassistant/components/satel_integra/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for Satel Integra zone states- represented as binary sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.satel_integra/ -""" +"""Support for Satel Integra zone states- represented as binary sensors.""" import logging from homeassistant.components.binary_sensor import BinarySensorDevice @@ -21,8 +16,8 @@ DEPENDENCIES = ['satel_integra'] _LOGGER = logging.getLogger(__name__) -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up the Satel Integra binary sensor devices.""" if not discovery_info: return @@ -34,8 +29,8 @@ async def async_setup_platform(hass, config, async_add_entities, for zone_num, device_config_data in configured_zones.items(): zone_type = device_config_data[CONF_ZONE_TYPE] zone_name = device_config_data[CONF_ZONE_NAME] - device = SatelIntegraBinarySensor(zone_num, zone_name, zone_type, - SIGNAL_ZONES_UPDATED) + device = SatelIntegraBinarySensor( + zone_num, zone_name, zone_type, SIGNAL_ZONES_UPDATED) devices.append(device) configured_outputs = discovery_info[CONF_OUTPUTS] @@ -43,8 +38,8 @@ async def async_setup_platform(hass, config, async_add_entities, for zone_num, device_config_data in configured_outputs.items(): zone_type = device_config_data[CONF_ZONE_TYPE] zone_name = device_config_data[CONF_ZONE_NAME] - device = SatelIntegraBinarySensor(zone_num, zone_name, zone_type, - SIGNAL_OUTPUTS_UPDATED) + device = SatelIntegraBinarySensor( + zone_num, zone_name, zone_type, SIGNAL_OUTPUTS_UPDATED) devices.append(device) async_add_entities(devices) diff --git a/homeassistant/components/scene/__init__.py b/homeassistant/components/scene/__init__.py index b3ab5228875..802512dbf5d 100644 --- a/homeassistant/components/scene/__init__.py +++ b/homeassistant/components/scene/__init__.py @@ -1,9 +1,4 @@ -""" -Allow users to set and activate scenes. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/scene/ -""" +"""Allow users to set and activate scenes.""" import asyncio import importlib import logging @@ -25,8 +20,7 @@ STATES = 'states' def _hass_domain_validator(config): """Validate platform in config for homeassistant domain.""" if CONF_PLATFORM not in config: - config = { - CONF_PLATFORM: HASS_DOMAIN, STATES: config} + config = {CONF_PLATFORM: HASS_DOMAIN, STATES: config} return config diff --git a/homeassistant/components/scene/homeassistant.py b/homeassistant/components/scene/homeassistant.py index 5812512ccef..96e24138b4a 100644 --- a/homeassistant/components/scene/homeassistant.py +++ b/homeassistant/components/scene/homeassistant.py @@ -1,9 +1,4 @@ -""" -Allow users to set and activate scenes. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/scene/ -""" +"""Allow users to set and activate scenes.""" from collections import namedtuple import voluptuous as vol diff --git a/homeassistant/components/scene/hunterdouglas_powerview.py b/homeassistant/components/scene/hunterdouglas_powerview.py index 7676deb1a9c..7f0709aa6c1 100644 --- a/homeassistant/components/scene/hunterdouglas_powerview.py +++ b/homeassistant/components/scene/hunterdouglas_powerview.py @@ -1,9 +1,4 @@ -""" -Support for Powerview scenes from a Powerview hub. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/scene.hunterdouglas_powerview/ -""" +"""Support for Powerview scenes from a Powerview hub.""" import logging import voluptuous as vol diff --git a/homeassistant/components/scene/lifx_cloud.py b/homeassistant/components/scene/lifx_cloud.py index c1dda86343d..c877bddbe53 100644 --- a/homeassistant/components/scene/lifx_cloud.py +++ b/homeassistant/components/scene/lifx_cloud.py @@ -1,9 +1,4 @@ -""" -Support for LIFX Cloud scenes. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/scene.lifx_cloud/ -""" +"""Support for LIFX Cloud scenes.""" import asyncio import logging diff --git a/homeassistant/components/scene/litejet.py b/homeassistant/components/scene/litejet.py index e12643fa651..2563c9ceb0c 100644 --- a/homeassistant/components/scene/litejet.py +++ b/homeassistant/components/scene/litejet.py @@ -1,9 +1,4 @@ -""" -Support for LiteJet scenes. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/scene.litejet/ -""" +"""Support for LiteJet scenes.""" import logging from homeassistant.components import litejet diff --git a/homeassistant/components/script/__init__.py b/homeassistant/components/script/__init__.py index e337a2ec251..fceedb57428 100644 --- a/homeassistant/components/script/__init__.py +++ b/homeassistant/components/script/__init__.py @@ -1,12 +1,4 @@ -""" -Support for scripts. - -Scripts are a sequence of actions that can be triggered manually -by the user or automatically based upon automation events, etc. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/script/ -""" +"""Support for scripts.""" import asyncio import logging diff --git a/homeassistant/components/scsgate/cover.py b/homeassistant/components/scsgate/cover.py index 2d85c1fe3c3..fc1c16e1ff3 100644 --- a/homeassistant/components/scsgate/cover.py +++ b/homeassistant/components/scsgate/cover.py @@ -1,9 +1,4 @@ -""" -Allow to configure a SCSGate cover. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/cover.scsgate/ -""" +"""Support for SCSGate covers.""" import logging import voluptuous as vol diff --git a/homeassistant/components/scsgate/light.py b/homeassistant/components/scsgate/light.py index c218e194791..87d7e02b383 100644 --- a/homeassistant/components/scsgate/light.py +++ b/homeassistant/components/scsgate/light.py @@ -1,9 +1,4 @@ -""" -Support for SCSGate lights. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/light.scsgate/ -""" +"""Support for SCSGate lights.""" import logging import voluptuous as vol diff --git a/homeassistant/components/scsgate/switch.py b/homeassistant/components/scsgate/switch.py index 9344aeab7ed..2b2bf2de94f 100644 --- a/homeassistant/components/scsgate/switch.py +++ b/homeassistant/components/scsgate/switch.py @@ -1,9 +1,4 @@ -""" -Support for SCSGate switches. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.scsgate/ -""" +"""Support for SCSGate switches.""" import logging import voluptuous as vol diff --git a/homeassistant/components/sense/__init__.py b/homeassistant/components/sense/__init__.py index 2fac2820230..11c45991400 100644 --- a/homeassistant/components/sense/__init__.py +++ b/homeassistant/components/sense/__init__.py @@ -1,9 +1,4 @@ -""" -Support for monitoring a Sense energy sensor. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sense/ -""" +"""Support for monitoring a Sense energy sensor.""" import logging import voluptuous as vol diff --git a/homeassistant/components/sense/binary_sensor.py b/homeassistant/components/sense/binary_sensor.py index a85a0c889d1..80fb8f2634d 100644 --- a/homeassistant/components/sense/binary_sensor.py +++ b/homeassistant/components/sense/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for monitoring a Sense energy sensor device. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.sense/ -""" +"""Support for monitoring a Sense energy sensor device.""" import logging from homeassistant.components.binary_sensor import BinarySensorDevice diff --git a/homeassistant/components/sense/sensor.py b/homeassistant/components/sense/sensor.py index 769b3a9e148..2995b860e5b 100644 --- a/homeassistant/components/sense/sensor.py +++ b/homeassistant/components/sense/sensor.py @@ -1,9 +1,4 @@ -""" -Support for monitoring a Sense energy sensor. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.sense/ -""" +"""Support for monitoring a Sense energy sensor.""" from datetime import timedelta import logging diff --git a/homeassistant/components/shell_command/__init__.py b/homeassistant/components/shell_command/__init__.py index f9ec8da54e3..e27870e2d86 100644 --- a/homeassistant/components/shell_command/__init__.py +++ b/homeassistant/components/shell_command/__init__.py @@ -1,9 +1,4 @@ -""" -Exposes regular shell commands as services. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/shell_command/ -""" +"""Expose regular shell commands as services.""" import asyncio import logging import shlex @@ -15,7 +10,6 @@ from homeassistant.core import ServiceCall from homeassistant.helpers import config_validation as cv, template from homeassistant.helpers.typing import ConfigType, HomeAssistantType - DOMAIN = 'shell_command' _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/shiftr/__init__.py b/homeassistant/components/shiftr/__init__.py index 17a46be4734..438bc36b1bf 100644 --- a/homeassistant/components/shiftr/__init__.py +++ b/homeassistant/components/shiftr/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Shiftr.io. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/shiftr/ -""" +"""Support for Shiftr.io.""" import logging import voluptuous as vol diff --git a/homeassistant/components/shopping_list/__init__.py b/homeassistant/components/shopping_list/__init__.py index 2ebd80c3de0..1a036f3661a 100644 --- a/homeassistant/components/shopping_list/__init__.py +++ b/homeassistant/components/shopping_list/__init__.py @@ -1,4 +1,4 @@ -"""Component to manage a shopping list.""" +"""Support to manage a shopping list.""" import asyncio import logging import uuid diff --git a/homeassistant/components/simplisafe/__init__.py b/homeassistant/components/simplisafe/__init__.py index 7f1f8f539eb..fcd9d15839b 100644 --- a/homeassistant/components/simplisafe/__init__.py +++ b/homeassistant/components/simplisafe/__init__.py @@ -1,9 +1,4 @@ -""" -Support for SimpliSafe alarm systems. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/simplisafe/ -""" +"""Support for SimpliSafe alarm systems.""" import logging from datetime import timedelta @@ -36,7 +31,7 @@ ACCOUNT_CONFIG_SCHEMA = vol.Schema({ vol.Required(CONF_PASSWORD): cv.string, vol.Optional(CONF_CODE): cv.string, vol.Optional(CONF_SCAN_INTERVAL, default=DEFAULT_SCAN_INTERVAL): - cv.time_period + cv.time_period, }) CONFIG_SCHEMA = vol.Schema({ diff --git a/homeassistant/components/simplisafe/alarm_control_panel.py b/homeassistant/components/simplisafe/alarm_control_panel.py index 626a819b0b9..9fdeea73da8 100644 --- a/homeassistant/components/simplisafe/alarm_control_panel.py +++ b/homeassistant/components/simplisafe/alarm_control_panel.py @@ -1,9 +1,4 @@ -""" -This platform provides alarm control functionality for SimpliSafe. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/alarm_control_panel.simplisafe/ -""" +"""Support for SimpliSafe alarm control panels.""" import logging import re diff --git a/homeassistant/components/simplisafe/config_flow.py b/homeassistant/components/simplisafe/config_flow.py index 0a59dcb3e1d..66e26bd5204 100644 --- a/homeassistant/components/simplisafe/config_flow.py +++ b/homeassistant/components/simplisafe/config_flow.py @@ -1,5 +1,4 @@ """Config flow to configure the SimpliSafe component.""" - from collections import OrderedDict import voluptuous as vol diff --git a/homeassistant/components/sisyphus/__init__.py b/homeassistant/components/sisyphus/__init__.py index f875e3a91c7..b1bec15d40e 100644 --- a/homeassistant/components/sisyphus/__init__.py +++ b/homeassistant/components/sisyphus/__init__.py @@ -1,9 +1,4 @@ -""" -Support for controlling Sisyphus Kinetic Art Tables. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/sisyphus/ -""" +"""Support for controlling Sisyphus Kinetic Art Tables.""" import asyncio import logging diff --git a/homeassistant/components/sisyphus/light.py b/homeassistant/components/sisyphus/light.py index 75cc86a0154..c9d20959696 100644 --- a/homeassistant/components/sisyphus/light.py +++ b/homeassistant/components/sisyphus/light.py @@ -1,9 +1,4 @@ -""" -Support for the light on the Sisyphus Kinetic Art Table. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/light.sisyphus/ -""" +"""Support for the light on the Sisyphus Kinetic Art Table.""" import logging from homeassistant.const import CONF_NAME @@ -26,15 +21,10 @@ def setup_platform(hass, config, add_entities, discovery_info=None): class SisyphusLight(Light): - """Represents a Sisyphus table as a light.""" + """Representation of a Sisyphus table as a light.""" def __init__(self, name, table): - """ - Constructor. - - :param name: name of the table - :param table: sisyphus-control Table object - """ + """Initialize the Sisyphus table.""" self._name = name self._table = table diff --git a/homeassistant/components/sisyphus/media_player.py b/homeassistant/components/sisyphus/media_player.py index fd8c228d396..463ac2b6cd1 100644 --- a/homeassistant/components/sisyphus/media_player.py +++ b/homeassistant/components/sisyphus/media_player.py @@ -1,9 +1,4 @@ -""" -Support for track controls on the Sisyphus Kinetic Art Table. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/media_player.sisyphus/ -""" +"""Support for track controls on the Sisyphus Kinetic Art Table.""" import logging from homeassistant.components.media_player import MediaPlayerDevice diff --git a/homeassistant/components/skybell/__init__.py b/homeassistant/components/skybell/__init__.py index ee384fd7094..8724f7d3d66 100644 --- a/homeassistant/components/skybell/__init__.py +++ b/homeassistant/components/skybell/__init__.py @@ -1,9 +1,4 @@ -""" -Support for the Skybell HD Doorbell. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/skybell/ -""" +"""Support for the Skybell HD Doorbell.""" import logging from requests.exceptions import HTTPError, ConnectTimeout diff --git a/homeassistant/components/skybell/binary_sensor.py b/homeassistant/components/skybell/binary_sensor.py index 7d8b3a84a2a..169e1b51a4e 100644 --- a/homeassistant/components/skybell/binary_sensor.py +++ b/homeassistant/components/skybell/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Binary sensor support for the Skybell HD Doorbell. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.skybell/ -""" +"""Binary sensor support for the Skybell HD Doorbell.""" from datetime import timedelta import logging diff --git a/homeassistant/components/skybell/camera.py b/homeassistant/components/skybell/camera.py index 3ad95e40d62..c22489aa654 100644 --- a/homeassistant/components/skybell/camera.py +++ b/homeassistant/components/skybell/camera.py @@ -1,9 +1,4 @@ -""" -Camera support for the Skybell HD Doorbell. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/camera.skybell/ -""" +"""Camera support for the Skybell HD Doorbell.""" from datetime import timedelta import logging diff --git a/homeassistant/components/skybell/light.py b/homeassistant/components/skybell/light.py index ecb240f2ef3..02be279f609 100644 --- a/homeassistant/components/skybell/light.py +++ b/homeassistant/components/skybell/light.py @@ -1,9 +1,4 @@ -""" -Light/LED support for the Skybell HD Doorbell. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/light.skybell/ -""" +"""Light/LED support for the Skybell HD Doorbell.""" import logging diff --git a/homeassistant/components/skybell/sensor.py b/homeassistant/components/skybell/sensor.py index de8c3a5694d..89841ae74ef 100644 --- a/homeassistant/components/skybell/sensor.py +++ b/homeassistant/components/skybell/sensor.py @@ -1,9 +1,4 @@ -""" -Sensor support for Skybell Doorbells. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.skybell/ -""" +"""Sensor support for Skybell Doorbells.""" from datetime import timedelta import logging diff --git a/homeassistant/components/skybell/switch.py b/homeassistant/components/skybell/switch.py index 9d791aa3df3..32f1d7f9392 100644 --- a/homeassistant/components/skybell/switch.py +++ b/homeassistant/components/skybell/switch.py @@ -1,9 +1,4 @@ -""" -Switch support for the Skybell HD Doorbell. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.skybell/ -""" +"""Switch support for the Skybell HD Doorbell.""" import logging import voluptuous as vol @@ -53,8 +48,8 @@ class SkybellSwitch(SkybellDevice, SwitchDevice): """Initialize a light for a Skybell device.""" super().__init__(device) self._switch_type = switch_type - self._name = "{0} {1}".format(self._device.name, - SWITCH_TYPES[self._switch_type][0]) + self._name = "{0} {1}".format( + self._device.name, SWITCH_TYPES[self._switch_type][0]) @property def name(self): diff --git a/homeassistant/components/sleepiq/__init__.py b/homeassistant/components/sleepiq/__init__.py index 4d4ecf0160b..7a23c6c4609 100644 --- a/homeassistant/components/sleepiq/__init__.py +++ b/homeassistant/components/sleepiq/__init__.py @@ -1,9 +1,4 @@ -""" -Support for SleepIQ from SleepNumber. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sleepiq/ -""" +"""Support for SleepIQ from SleepNumber.""" import logging from datetime import timedelta from requests.exceptions import HTTPError diff --git a/homeassistant/components/smappee/__init__.py b/homeassistant/components/smappee/__init__.py index d8b7a68a506..7a495d7b89a 100644 --- a/homeassistant/components/smappee/__init__.py +++ b/homeassistant/components/smappee/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Smappee energy monitor. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/smappee/ -""" +"""Support for Smappee energy monitor.""" import logging from datetime import datetime, timedelta import re diff --git a/homeassistant/components/smappee/sensor.py b/homeassistant/components/smappee/sensor.py index 65f21815960..67213ab15bf 100644 --- a/homeassistant/components/smappee/sensor.py +++ b/homeassistant/components/smappee/sensor.py @@ -1,9 +1,4 @@ -""" -Support for monitoring a Smappee energy sensor. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.smappee/ -""" +"""Support for monitoring a Smappee energy sensor.""" import logging from datetime import timedelta diff --git a/homeassistant/components/smappee/switch.py b/homeassistant/components/smappee/switch.py index fc2716b8019..3b9bee081f7 100644 --- a/homeassistant/components/smappee/switch.py +++ b/homeassistant/components/smappee/switch.py @@ -1,9 +1,4 @@ -""" -Support for interacting with Smappee Comport Plugs. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/switch.smappee/ -""" +"""Support for interacting with Smappee Comport Plugs.""" import logging from homeassistant.components.smappee import DATA_SMAPPEE @@ -26,17 +21,14 @@ def setup_platform(hass, config, add_entities, discovery_info=None): for items in smappee.info[location_id].get('actuators'): if items.get('name') != '': _LOGGER.debug("Remote actuator %s", items) - dev.append(SmappeeSwitch(smappee, - items.get('name'), - location_id, - items.get('id'))) + dev.append(SmappeeSwitch( + smappee, items.get('name'), location_id, + items.get('id'))) elif smappee.is_local_active: for items in smappee.local_devices: _LOGGER.debug("Local actuator %s", items) - dev.append(SmappeeSwitch(smappee, - items.get('value'), - None, - items.get('key'))) + dev.append(SmappeeSwitch( + smappee, items.get('value'), None, items.get('key'))) add_entities(dev) diff --git a/homeassistant/components/smartthings/__init__.py b/homeassistant/components/smartthings/__init__.py index 0d86289e11c..04da29aa55e 100644 --- a/homeassistant/components/smartthings/__init__.py +++ b/homeassistant/components/smartthings/__init__.py @@ -1,5 +1,4 @@ -"""SmartThings Cloud integration for Home Assistant.""" - +"""Support for SmartThings Cloud.""" import asyncio import logging from typing import Iterable diff --git a/homeassistant/components/smartthings/binary_sensor.py b/homeassistant/components/smartthings/binary_sensor.py index 045944ccfa9..2fbb6f719da 100644 --- a/homeassistant/components/smartthings/binary_sensor.py +++ b/homeassistant/components/smartthings/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for binary sensors through the SmartThings cloud API. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/smartthings.binary_sensor/ -""" +"""Support for binary sensors through the SmartThings cloud API.""" from homeassistant.components.binary_sensor import BinarySensorDevice from . import SmartThingsEntity @@ -20,7 +15,7 @@ CAPABILITY_TO_ATTRIB = { 'soundSensor': 'sound', 'tamperAlert': 'tamper', 'valve': 'valve', - 'waterSensor': 'water' + 'waterSensor': 'water', } ATTRIB_TO_CLASS = { 'acceleration': 'moving', @@ -31,7 +26,7 @@ ATTRIB_TO_CLASS = { 'sound': 'sound', 'tamper': 'problem', 'valve': 'opening', - 'water': 'moisture' + 'water': 'moisture', } diff --git a/homeassistant/components/smartthings/climate.py b/homeassistant/components/smartthings/climate.py index 5a79270307c..9340bcef337 100644 --- a/homeassistant/components/smartthings/climate.py +++ b/homeassistant/components/smartthings/climate.py @@ -1,9 +1,4 @@ -""" -Support for climate entities/thermostats through the SmartThings cloud API. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/smartthings.climate/ -""" +"""Support for climate devices through the SmartThings cloud API.""" import asyncio from homeassistant.components.climate import ( diff --git a/homeassistant/components/smartthings/fan.py b/homeassistant/components/smartthings/fan.py index 7862736e60b..4de1744c9b8 100644 --- a/homeassistant/components/smartthings/fan.py +++ b/homeassistant/components/smartthings/fan.py @@ -1,10 +1,4 @@ -""" -Support for fans through the SmartThings cloud API. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/smartthings.fan/ -""" - +"""Support for fans through the SmartThings cloud API.""" from homeassistant.components.fan import ( SPEED_HIGH, SPEED_LOW, SPEED_MEDIUM, SPEED_OFF, SUPPORT_SET_SPEED, FanEntity) diff --git a/homeassistant/components/smartthings/light.py b/homeassistant/components/smartthings/light.py index 8495be62a73..ce4b00ca1fe 100644 --- a/homeassistant/components/smartthings/light.py +++ b/homeassistant/components/smartthings/light.py @@ -1,9 +1,4 @@ -""" -Support for lights through the SmartThings cloud API. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/smartthings.light/ -""" +"""Support for lights through the SmartThings cloud API.""" import asyncio from homeassistant.components.light import ( diff --git a/homeassistant/components/smartthings/sensor.py b/homeassistant/components/smartthings/sensor.py index 5539703e77e..eb83334c6b3 100644 --- a/homeassistant/components/smartthings/sensor.py +++ b/homeassistant/components/smartthings/sensor.py @@ -1,9 +1,4 @@ -""" -Support for sensors through the SmartThings cloud API. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/smartthings.sensor/ -""" +"""Support for sensors through the SmartThings cloud API.""" from collections import namedtuple from homeassistant.const import ( diff --git a/homeassistant/components/smartthings/switch.py b/homeassistant/components/smartthings/switch.py index 1fccfcd3619..08cdb74ed77 100644 --- a/homeassistant/components/smartthings/switch.py +++ b/homeassistant/components/smartthings/switch.py @@ -1,9 +1,4 @@ -""" -Support for switches through the SmartThings cloud API. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/smartthings.switch/ -""" +"""Support for switches through the SmartThings cloud API.""" from homeassistant.components.switch import SwitchDevice from . import SmartThingsEntity @@ -12,8 +7,8 @@ from .const import DATA_BROKERS, DOMAIN DEPENDENCIES = ['smartthings'] -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Platform uses config entry setup.""" pass diff --git a/homeassistant/components/smhi/__init__.py b/homeassistant/components/smhi/__init__.py index ba7ccc2f682..6af8c14843b 100644 --- a/homeassistant/components/smhi/__init__.py +++ b/homeassistant/components/smhi/__init__.py @@ -1,9 +1,4 @@ -""" -Component for the Swedish weather institute weather service. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/smhi/ -""" +"""Support for the Swedish weather institute weather service.""" from homeassistant.config_entries import ConfigEntry from homeassistant.core import Config, HomeAssistant diff --git a/homeassistant/components/smhi/weather.py b/homeassistant/components/smhi/weather.py index 79fd1166a4b..75a0c51d010 100644 --- a/homeassistant/components/smhi/weather.py +++ b/homeassistant/components/smhi/weather.py @@ -1,9 +1,4 @@ -""" -Support for the Swedish weather institute weather service. - -For more details about this platform, please refer to the documentation -https://home-assistant.io/components/weather.smhi/ -""" +"""Support for the Swedish weather institute weather service.""" import asyncio from datetime import timedelta import logging diff --git a/homeassistant/components/snips/__init__.py b/homeassistant/components/snips/__init__.py index 1aebeae59cb..9a5508c8f32 100644 --- a/homeassistant/components/snips/__init__.py +++ b/homeassistant/components/snips/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Snips on-device ASR and NLU. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/snips/ -""" +"""Support for Snips on-device ASR and NLU.""" import json import logging from datetime import timedelta diff --git a/homeassistant/components/sonos/__init__.py b/homeassistant/components/sonos/__init__.py index b4f507a60dd..69d5a9bfc33 100644 --- a/homeassistant/components/sonos/__init__.py +++ b/homeassistant/components/sonos/__init__.py @@ -1,4 +1,4 @@ -"""Component to embed Sonos.""" +"""Support to embed Sonos.""" from homeassistant import config_entries from homeassistant.helpers import config_entry_flow diff --git a/homeassistant/components/sonos/media_player.py b/homeassistant/components/sonos/media_player.py index 2106e46cb5d..2a7eafaf835 100644 --- a/homeassistant/components/sonos/media_player.py +++ b/homeassistant/components/sonos/media_player.py @@ -1,9 +1,4 @@ -""" -Support to interface with Sonos players. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/media_player.sonos/ -""" +"""Support to interface with Sonos players.""" import datetime import functools as ft import logging diff --git a/homeassistant/components/spaceapi/__init__.py b/homeassistant/components/spaceapi/__init__.py index fa2e5e8e1ea..fb76718f2d5 100644 --- a/homeassistant/components/spaceapi/__init__.py +++ b/homeassistant/components/spaceapi/__init__.py @@ -1,9 +1,4 @@ -""" -Support for the SpaceAPI. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/spaceapi/ -""" +"""Support for the SpaceAPI.""" import logging import voluptuous as vol diff --git a/homeassistant/components/spc/__init__.py b/homeassistant/components/spc/__init__.py index dd1931e27f1..8aafb6f1210 100644 --- a/homeassistant/components/spc/__init__.py +++ b/homeassistant/components/spc/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Vanderbilt (formerly Siemens) SPC alarm systems. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/spc/ -""" +"""Support for Vanderbilt (formerly Siemens) SPC alarm systems.""" import logging import voluptuous as vol diff --git a/homeassistant/components/speedtestdotnet/__init__.py b/homeassistant/components/speedtestdotnet/__init__.py index ce6f376d1b0..3b8d2964f83 100644 --- a/homeassistant/components/speedtestdotnet/__init__.py +++ b/homeassistant/components/speedtestdotnet/__init__.py @@ -1,9 +1,4 @@ -""" -Support for testing internet speed via Speedtest.net. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/speedtestdotnet/ -""" +"""Support for testing internet speed via Speedtest.net.""" import logging from datetime import timedelta diff --git a/homeassistant/components/speedtestdotnet/sensor.py b/homeassistant/components/speedtestdotnet/sensor.py index 33557ddacab..4deb6550444 100644 --- a/homeassistant/components/speedtestdotnet/sensor.py +++ b/homeassistant/components/speedtestdotnet/sensor.py @@ -1,9 +1,4 @@ -""" -Support for Speedtest.net internet speed testing sensor. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.speedtestdotnet/ -""" +"""Support for Speedtest.net internet speed testing sensor.""" import logging from homeassistant.components.speedtestdotnet.const import \ @@ -30,8 +25,8 @@ ATTRIBUTION = 'Data retrieved from Speedtest.net by Ookla' ICON = 'mdi:speedometer' -async def async_setup_platform(hass, config, async_add_entities, - discovery_info): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info): """Set up the Speedtest.net sensor.""" data = hass.data[SPEEDTESTDOTNET_DOMAIN] async_add_entities( diff --git a/homeassistant/components/spider/__init__.py b/homeassistant/components/spider/__init__.py index 5b991e0d3e2..b565f183457 100644 --- a/homeassistant/components/spider/__init__.py +++ b/homeassistant/components/spider/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Spider Smart devices. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/spider/ -""" +"""Support for Spider Smart devices.""" from datetime import timedelta import logging diff --git a/homeassistant/components/spider/climate.py b/homeassistant/components/spider/climate.py index cfef50e8255..08af44ad1ad 100644 --- a/homeassistant/components/spider/climate.py +++ b/homeassistant/components/spider/climate.py @@ -1,9 +1,4 @@ -""" -Support for Spider thermostats. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/climate.spider/ -""" +"""Support for Spider thermostats.""" import logging @@ -23,7 +18,7 @@ FAN_LIST = [ 'High', 'Boost 10', 'Boost 20', - 'Boost 30' + 'Boost 30', ] OPERATION_LIST = [ @@ -34,7 +29,7 @@ OPERATION_LIST = [ HA_STATE_TO_SPIDER = { STATE_COOL: 'Cool', STATE_HEAT: 'Heat', - STATE_IDLE: 'Idle' + STATE_IDLE: 'Idle', } SPIDER_STATE_TO_HA = {value: key for key, value in HA_STATE_TO_SPIDER.items()} diff --git a/homeassistant/components/spider/switch.py b/homeassistant/components/spider/switch.py index f4bf74ad010..227e4748515 100644 --- a/homeassistant/components/spider/switch.py +++ b/homeassistant/components/spider/switch.py @@ -1,10 +1,4 @@ -""" -Support for Spider switches. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.spider/ -""" - +"""Support for Spider switches.""" import logging from homeassistant.components.spider import DOMAIN as SPIDER_DOMAIN diff --git a/homeassistant/components/splunk/__init__.py b/homeassistant/components/splunk/__init__.py index 37f56ed3b1c..fed05fe3498 100644 --- a/homeassistant/components/splunk/__init__.py +++ b/homeassistant/components/splunk/__init__.py @@ -1,9 +1,4 @@ -""" -Support to send data to an Splunk instance. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/splunk/ -""" +"""Support to send data to an Splunk instance.""" import json import logging diff --git a/homeassistant/components/statsd/__init__.py b/homeassistant/components/statsd/__init__.py index 6b528733601..a8c34d0a843 100644 --- a/homeassistant/components/statsd/__init__.py +++ b/homeassistant/components/statsd/__init__.py @@ -1,9 +1,4 @@ -""" -A component which allows you to send data to StatsD. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/statsd/ -""" +"""Support for sending data to StatsD.""" import logging import voluptuous as vol diff --git a/homeassistant/components/sun/__init__.py b/homeassistant/components/sun/__init__.py index 250c6a2ed2f..92cdcb0a2e4 100644 --- a/homeassistant/components/sun/__init__.py +++ b/homeassistant/components/sun/__init__.py @@ -1,9 +1,4 @@ -""" -Support for functionality to keep track of the sun. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/sun/ -""" +"""Support for functionality to keep track of the sun.""" import logging from datetime import timedelta diff --git a/homeassistant/components/system_health/__init__.py b/homeassistant/components/system_health/__init__.py index 05e5b76fb5b..9a171296ce9 100644 --- a/homeassistant/components/system_health/__init__.py +++ b/homeassistant/components/system_health/__init__.py @@ -1,9 +1,4 @@ -""" -System health component. - -For more details about this component, please refer to the documentation at -https://www.home-assistant.io/components/system_health/ -""" +"""Support for System health .""" import asyncio from collections import OrderedDict import logging diff --git a/homeassistant/components/system_log/__init__.py b/homeassistant/components/system_log/__init__.py index c59aee56a51..9e968111c9c 100644 --- a/homeassistant/components/system_log/__init__.py +++ b/homeassistant/components/system_log/__init__.py @@ -1,9 +1,4 @@ -""" -Support for system log. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/system_log/ -""" +"""Support for system log.""" from collections import OrderedDict import logging import re diff --git a/homeassistant/components/tado/__init__.py b/homeassistant/components/tado/__init__.py index 7c045518132..767e29ba0b9 100644 --- a/homeassistant/components/tado/__init__.py +++ b/homeassistant/components/tado/__init__.py @@ -1,9 +1,4 @@ -""" -Support for the (unofficial) Tado api. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/tado/ -""" +"""Support for the (unofficial) Tado API.""" import logging import urllib from datetime import timedelta @@ -31,7 +26,7 @@ TADO_COMPONENTS = [ CONFIG_SCHEMA = vol.Schema({ DOMAIN: vol.Schema({ vol.Required(CONF_USERNAME): cv.string, - vol.Required(CONF_PASSWORD): cv.string + vol.Required(CONF_PASSWORD): cv.string, }) }, extra=vol.ALLOW_EXTRA) diff --git a/homeassistant/components/tado/climate.py b/homeassistant/components/tado/climate.py index 1e52c163624..1812d36b7cd 100644 --- a/homeassistant/components/tado/climate.py +++ b/homeassistant/components/tado/climate.py @@ -1,9 +1,4 @@ -""" -Tado component to create a climate device for each zone. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/climate.tado/ -""" +"""Support for Tado to create a climate device for each zone.""" import logging from homeassistant.const import (PRECISION_TENTHS, TEMP_CELSIUS) diff --git a/homeassistant/components/tado/device_tracker.py b/homeassistant/components/tado/device_tracker.py index ef816338ce9..7812bbd812b 100644 --- a/homeassistant/components/tado/device_tracker.py +++ b/homeassistant/components/tado/device_tracker.py @@ -1,9 +1,4 @@ -""" -Support for Tado Smart Thermostat. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/device_tracker.tado/ -""" +"""Support for Tado Smart device trackers.""" import logging from datetime import timedelta from collections import namedtuple @@ -29,7 +24,7 @@ MIN_TIME_BETWEEN_SCANS = timedelta(seconds=30) PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ vol.Required(CONF_USERNAME): cv.string, vol.Required(CONF_PASSWORD): cv.string, - vol.Optional(CONF_HOME_ID): cv.string + vol.Optional(CONF_HOME_ID): cv.string, }) diff --git a/homeassistant/components/tado/sensor.py b/homeassistant/components/tado/sensor.py index 46ad6206fff..a1eb918ac5d 100644 --- a/homeassistant/components/tado/sensor.py +++ b/homeassistant/components/tado/sensor.py @@ -1,9 +1,4 @@ -""" -Tado component to create some sensors for each zone. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.tado/ -""" +"""Support for Tado sensors for each zone.""" import logging from homeassistant.components.tado import DATA_TADO diff --git a/homeassistant/components/tahoma/__init__.py b/homeassistant/components/tahoma/__init__.py index 5e30b845863..e76cadc7ce3 100644 --- a/homeassistant/components/tahoma/__init__.py +++ b/homeassistant/components/tahoma/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Tahoma devices. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/tahoma/ -""" +"""Support for Tahoma devices.""" from collections import defaultdict import logging import voluptuous as vol diff --git a/homeassistant/components/tahoma/binary_sensor.py b/homeassistant/components/tahoma/binary_sensor.py index 73035a2da0d..69855f7cb57 100644 --- a/homeassistant/components/tahoma/binary_sensor.py +++ b/homeassistant/components/tahoma/binary_sensor.py @@ -1,10 +1,4 @@ -""" -Support for Tahoma binary sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.tahoma/ -""" - +"""Support for Tahoma binary sensors.""" import logging from datetime import timedelta diff --git a/homeassistant/components/tahoma/cover.py b/homeassistant/components/tahoma/cover.py index baf32073c44..6dbf9a39807 100644 --- a/homeassistant/components/tahoma/cover.py +++ b/homeassistant/components/tahoma/cover.py @@ -1,9 +1,4 @@ -""" -Support for Tahoma cover - shutters etc. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/cover.tahoma/ -""" +"""Support for Tahoma cover - shutters etc.""" from datetime import timedelta import logging diff --git a/homeassistant/components/tahoma/scene.py b/homeassistant/components/tahoma/scene.py index 5846d97c7f9..643cc65aa19 100644 --- a/homeassistant/components/tahoma/scene.py +++ b/homeassistant/components/tahoma/scene.py @@ -1,9 +1,4 @@ -""" -Support for Tahoma scenes. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/scene.tahoma/ -""" +"""Support for Tahoma scenes.""" import logging from homeassistant.components.scene import Scene diff --git a/homeassistant/components/tahoma/sensor.py b/homeassistant/components/tahoma/sensor.py index 5918bd7c9f8..8a2ea976ba7 100644 --- a/homeassistant/components/tahoma/sensor.py +++ b/homeassistant/components/tahoma/sensor.py @@ -1,10 +1,4 @@ -""" -Support for Tahoma sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.tahoma/ -""" - +"""Support for Tahoma sensors.""" import logging from datetime import timedelta diff --git a/homeassistant/components/tahoma/switch.py b/homeassistant/components/tahoma/switch.py index bcac038d43b..779bff9ce0d 100644 --- a/homeassistant/components/tahoma/switch.py +++ b/homeassistant/components/tahoma/switch.py @@ -1,12 +1,4 @@ -""" -Support for Tahoma Switch - those are push buttons for garage door etc. - -Those buttons are implemented as switches that are never on. They only -receive the turn_on action, perform the relay click, and stay in OFF state - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.tahoma/ -""" +"""Support for Tahoma switches.""" import logging from homeassistant.components.switch import SwitchDevice diff --git a/homeassistant/components/telegram_bot/__init__.py b/homeassistant/components/telegram_bot/__init__.py index 28bc7a1ad0d..18f206541df 100644 --- a/homeassistant/components/telegram_bot/__init__.py +++ b/homeassistant/components/telegram_bot/__init__.py @@ -1,9 +1,4 @@ -""" -Component to send and receive Telegram messages. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/telegram_bot/ -""" +"""Support to send and receive Telegram messages.""" import io from functools import partial import logging diff --git a/homeassistant/components/telegram_bot/broadcast.py b/homeassistant/components/telegram_bot/broadcast.py index 7cfcc272a33..eb52ab496d7 100644 --- a/homeassistant/components/telegram_bot/broadcast.py +++ b/homeassistant/components/telegram_bot/broadcast.py @@ -1,9 +1,4 @@ -""" -Telegram bot implementation to send messages only. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/telegram_bot.broadcast/ -""" +"""Support for Telegram bot to send messages only.""" import logging from homeassistant.components.telegram_bot import ( @@ -17,8 +12,6 @@ PLATFORM_SCHEMA = TELEGRAM_PLATFORM_SCHEMA async def async_setup_platform(hass, config): """Set up the Telegram broadcast platform.""" - # Check the API key works - bot = initialize_bot(config) bot_config = await hass.async_add_job(bot.getMe) diff --git a/homeassistant/components/telegram_bot/polling.py b/homeassistant/components/telegram_bot/polling.py index d1dea051985..5bca4321a5f 100644 --- a/homeassistant/components/telegram_bot/polling.py +++ b/homeassistant/components/telegram_bot/polling.py @@ -1,9 +1,4 @@ -""" -Telegram bot polling implementation. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/telegram_bot.polling/ -""" +"""Support for Telegram bot using polling.""" import logging from homeassistant.components.telegram_bot import ( diff --git a/homeassistant/components/telegram_bot/webhooks.py b/homeassistant/components/telegram_bot/webhooks.py index 5406ba60b13..41a206944e7 100644 --- a/homeassistant/components/telegram_bot/webhooks.py +++ b/homeassistant/components/telegram_bot/webhooks.py @@ -1,9 +1,4 @@ -""" -Allows utilizing telegram webhooks. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/telegram_bot.webhooks/ -""" +"""Support for Telegram bots using webhooks.""" import datetime as dt from ipaddress import ip_network import logging diff --git a/homeassistant/components/tellduslive/__init__.py b/homeassistant/components/tellduslive/__init__.py index 2a57a78ee9e..1a6f35fe8d8 100644 --- a/homeassistant/components/tellduslive/__init__.py +++ b/homeassistant/components/tellduslive/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Telldus Live. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/tellduslive/ -""" +"""Support for Telldus Live.""" import asyncio from functools import partial import logging @@ -32,8 +27,7 @@ CONFIG_SCHEMA = vol.Schema( { DOMAIN: vol.Schema({ - vol.Optional(CONF_HOST, default=DOMAIN): - cv.string, + vol.Optional(CONF_HOST, default=DOMAIN): cv.string, vol.Optional(CONF_UPDATE_INTERVAL, default=SCAN_INTERVAL): (vol.All(cv.time_period, vol.Clamp(min=MIN_UPDATE_INTERVAL))) }), diff --git a/homeassistant/components/tellduslive/binary_sensor.py b/homeassistant/components/tellduslive/binary_sensor.py index f6ed85db132..85faeca96d4 100644 --- a/homeassistant/components/tellduslive/binary_sensor.py +++ b/homeassistant/components/tellduslive/binary_sensor.py @@ -1,12 +1,4 @@ -""" -Support for binary sensors using Tellstick Net. - -This platform uses the Telldus Live online service. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.tellduslive/ - -""" +"""Support for binary sensors using Tellstick Net.""" import logging from homeassistant.components import binary_sensor, tellduslive @@ -35,8 +27,8 @@ async def async_setup_entry(hass, config_entry, async_add_entities): async_dispatcher_connect( hass, - tellduslive.TELLDUS_DISCOVERY_NEW.format(binary_sensor.DOMAIN, - tellduslive.DOMAIN), + tellduslive.TELLDUS_DISCOVERY_NEW.format( + binary_sensor.DOMAIN, tellduslive.DOMAIN), async_discover_binary_sensor) diff --git a/homeassistant/components/tellduslive/cover.py b/homeassistant/components/tellduslive/cover.py index 1879c88c83c..5a22311d7f0 100644 --- a/homeassistant/components/tellduslive/cover.py +++ b/homeassistant/components/tellduslive/cover.py @@ -1,11 +1,4 @@ -""" -Support for Tellstick covers using Tellstick Net. - -This platform uses the Telldus Live online service. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/cover.tellduslive/ -""" +"""Support for Tellstick covers using Tellstick Net.""" import logging from homeassistant.components import cover, tellduslive diff --git a/homeassistant/components/tellduslive/entry.py b/homeassistant/components/tellduslive/entry.py index d6e56329699..9255f9da645 100644 --- a/homeassistant/components/tellduslive/entry.py +++ b/homeassistant/components/tellduslive/entry.py @@ -1,4 +1,4 @@ -"""Base Entity for all TelldusLiveEntities.""" +"""Base Entity for all TelldusLive entities.""" from datetime import datetime import logging diff --git a/homeassistant/components/tellduslive/light.py b/homeassistant/components/tellduslive/light.py index 3f14b34ea78..10eaee1ad8b 100644 --- a/homeassistant/components/tellduslive/light.py +++ b/homeassistant/components/tellduslive/light.py @@ -1,11 +1,4 @@ -""" -Support for Tellstick switches using Tellstick Net. - -This platform uses the Telldus Live online service. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/light.tellduslive/ -""" +"""Support for Tellstick lights using Tellstick Net.""" import logging from homeassistant.components import light, tellduslive diff --git a/homeassistant/components/tellduslive/sensor.py b/homeassistant/components/tellduslive/sensor.py index f024f62109b..48133fd69e6 100644 --- a/homeassistant/components/tellduslive/sensor.py +++ b/homeassistant/components/tellduslive/sensor.py @@ -1,9 +1,4 @@ -""" -Support for Tellstick Net/Telstick Live. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.tellduslive/ -""" +"""Support for Tellstick Net/Telstick Live sensors.""" import logging from homeassistant.components import sensor, tellduslive diff --git a/homeassistant/components/tellduslive/switch.py b/homeassistant/components/tellduslive/switch.py index 5c04e872623..63d1512698c 100644 --- a/homeassistant/components/tellduslive/switch.py +++ b/homeassistant/components/tellduslive/switch.py @@ -1,12 +1,4 @@ -""" -Support for Tellstick switches using Tellstick Net. - -This platform uses the Telldus Live online service. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.tellduslive/ - -""" +"""Support for Tellstick switches using Tellstick Net.""" import logging from homeassistant.components import switch, tellduslive diff --git a/homeassistant/components/tellstick/__init__.py b/homeassistant/components/tellstick/__init__.py index 8f1c45d7312..c35d2f79027 100644 --- a/homeassistant/components/tellstick/__init__.py +++ b/homeassistant/components/tellstick/__init__.py @@ -1,9 +1,4 @@ -""" -Tellstick Component. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/tellstick/ -""" +"""Support for Tellstick.""" import logging import threading diff --git a/homeassistant/components/tellstick/cover.py b/homeassistant/components/tellstick/cover.py index 88608ac42e9..d0c9c031435 100644 --- a/homeassistant/components/tellstick/cover.py +++ b/homeassistant/components/tellstick/cover.py @@ -1,11 +1,4 @@ -""" -Support for Tellstick covers. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/cover.tellstick/ -""" - - +"""Support for Tellstick covers.""" from homeassistant.components.cover import CoverDevice from homeassistant.components.tellstick import ( DEFAULT_SIGNAL_REPETITIONS, ATTR_DISCOVER_DEVICES, ATTR_DISCOVER_CONFIG, diff --git a/homeassistant/components/tellstick/light.py b/homeassistant/components/tellstick/light.py index cf9dd545e99..5deee5e08a6 100644 --- a/homeassistant/components/tellstick/light.py +++ b/homeassistant/components/tellstick/light.py @@ -1,10 +1,4 @@ -""" -Support for Tellstick lights. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/light.tellstick/ -""" - +"""Support for Tellstick lights.""" from homeassistant.components.light import ( ATTR_BRIGHTNESS, SUPPORT_BRIGHTNESS, Light) from homeassistant.components.tellstick import ( diff --git a/homeassistant/components/tellstick/sensor.py b/homeassistant/components/tellstick/sensor.py index aac97580f2c..c6d281772a5 100644 --- a/homeassistant/components/tellstick/sensor.py +++ b/homeassistant/components/tellstick/sensor.py @@ -1,9 +1,4 @@ -""" -Support for Tellstick sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.tellstick/ -""" +"""Support for Tellstick sensors.""" import logging from collections import namedtuple diff --git a/homeassistant/components/tellstick/switch.py b/homeassistant/components/tellstick/switch.py index 51a04e9f5b3..56d563e494c 100644 --- a/homeassistant/components/tellstick/switch.py +++ b/homeassistant/components/tellstick/switch.py @@ -1,9 +1,4 @@ -""" -Support for Tellstick switches. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.tellstick/ -""" +"""Support for Tellstick switches.""" from homeassistant.components.tellstick import ( DEFAULT_SIGNAL_REPETITIONS, ATTR_DISCOVER_DEVICES, ATTR_DISCOVER_CONFIG, DATA_TELLSTICK, TellstickDevice) diff --git a/homeassistant/components/tesla/__init__.py b/homeassistant/components/tesla/__init__.py index 76b5c00d9d4..fc433ae18b1 100644 --- a/homeassistant/components/tesla/__init__.py +++ b/homeassistant/components/tesla/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Tesla cars. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/tesla/ -""" +"""Support for Tesla cars.""" from collections import defaultdict import logging diff --git a/homeassistant/components/tesla/binary_sensor.py b/homeassistant/components/tesla/binary_sensor.py index f7613d74dfb..2c037140f0a 100644 --- a/homeassistant/components/tesla/binary_sensor.py +++ b/homeassistant/components/tesla/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for Tesla binary sensor. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.tesla/ -""" +"""Support for Tesla binary sensor.""" import logging from homeassistant.components.binary_sensor import ( diff --git a/homeassistant/components/tesla/climate.py b/homeassistant/components/tesla/climate.py index ef5f2227c11..302c0006bcf 100644 --- a/homeassistant/components/tesla/climate.py +++ b/homeassistant/components/tesla/climate.py @@ -1,9 +1,4 @@ -""" -Support for Tesla HVAC system. - -For more details about this platform, please refer to the documentation -https://home-assistant.io/components/climate.tesla/ -""" +"""Support for Tesla HVAC system.""" import logging from homeassistant.components.climate import ( diff --git a/homeassistant/components/tesla/device_tracker.py b/homeassistant/components/tesla/device_tracker.py index c08ddb4047b..0aeab5b1c7d 100644 --- a/homeassistant/components/tesla/device_tracker.py +++ b/homeassistant/components/tesla/device_tracker.py @@ -1,9 +1,4 @@ -""" -Support for the Tesla platform. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/device_tracker.tesla/ -""" +"""Support for tracking Tesla cars.""" import logging from homeassistant.components.tesla import DOMAIN as TESLA_DOMAIN diff --git a/homeassistant/components/tesla/lock.py b/homeassistant/components/tesla/lock.py index 2ffb996aec3..34d660ac83c 100644 --- a/homeassistant/components/tesla/lock.py +++ b/homeassistant/components/tesla/lock.py @@ -1,9 +1,4 @@ -""" -Support for Tesla door locks. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/lock.tesla/ -""" +"""Support for Tesla door locks.""" import logging from homeassistant.components.lock import ENTITY_ID_FORMAT, LockDevice diff --git a/homeassistant/components/tesla/sensor.py b/homeassistant/components/tesla/sensor.py index 51b7ea2325d..1d4505ed9a4 100644 --- a/homeassistant/components/tesla/sensor.py +++ b/homeassistant/components/tesla/sensor.py @@ -1,9 +1,4 @@ -""" -Sensors for the Tesla sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.tesla/ -""" +"""Support for the Tesla sensors.""" from datetime import timedelta import logging diff --git a/homeassistant/components/tesla/switch.py b/homeassistant/components/tesla/switch.py index 30972b1014b..a1787e9993e 100644 --- a/homeassistant/components/tesla/switch.py +++ b/homeassistant/components/tesla/switch.py @@ -1,9 +1,4 @@ -""" -Support for Tesla charger switch. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.tesla/ -""" +"""Support for Tesla charger switches.""" import logging from homeassistant.components.switch import ENTITY_ID_FORMAT, SwitchDevice diff --git a/homeassistant/components/thethingsnetwork/__init__.py b/homeassistant/components/thethingsnetwork/__init__.py index 61f9843be45..952755d289e 100644 --- a/homeassistant/components/thethingsnetwork/__init__.py +++ b/homeassistant/components/thethingsnetwork/__init__.py @@ -1,9 +1,4 @@ -""" -Support for The Things network. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/thethingsnetwork/ -""" +"""Support for The Things network.""" import logging import voluptuous as vol diff --git a/homeassistant/components/thethingsnetwork/sensor.py b/homeassistant/components/thethingsnetwork/sensor.py index 13b51d505c3..05da90bf7ac 100644 --- a/homeassistant/components/thethingsnetwork/sensor.py +++ b/homeassistant/components/thethingsnetwork/sensor.py @@ -1,9 +1,4 @@ -""" -Support for The Things Network's Data storage integration. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/sensor.thethingsnetwork_data/ -""" +"""Support for The Things Network's Data storage integration.""" import asyncio import logging @@ -38,8 +33,8 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ }) -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up The Things Network Data storage sensors.""" ttn = hass.data.get(DATA_TTN) device_id = config.get(CONF_DEVICE_ID) diff --git a/homeassistant/components/thingspeak/__init__.py b/homeassistant/components/thingspeak/__init__.py index 9a876a87683..0fa15e7efb4 100644 --- a/homeassistant/components/thingspeak/__init__.py +++ b/homeassistant/components/thingspeak/__init__.py @@ -1,9 +1,4 @@ -""" -A component to submit data to thingspeak. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/thingspeak/ -""" +"""Support for submitting data to Thingspeak.""" import logging from requests.exceptions import RequestException @@ -26,8 +21,8 @@ CONFIG_SCHEMA = vol.Schema({ DOMAIN: vol.Schema({ vol.Required(CONF_API_KEY): cv.string, vol.Required(CONF_ID): int, - vol.Required(CONF_WHITELIST): cv.string - }), + vol.Required(CONF_WHITELIST): cv.string, + }), }, extra=vol.ALLOW_EXTRA) @@ -47,7 +42,7 @@ def setup(hass, config): except RequestException: _LOGGER.error("Error while accessing the ThingSpeak channel. " "Please check that the channel exists and your " - "API key is correct.") + "API key is correct") return False def thingspeak_listener(entity_id, old_state, new_state): diff --git a/homeassistant/components/thinkingcleaner/__init__.py b/homeassistant/components/thinkingcleaner/__init__.py index 5358060ea8a..a72cda45fd5 100644 --- a/homeassistant/components/thinkingcleaner/__init__.py +++ b/homeassistant/components/thinkingcleaner/__init__.py @@ -1 +1 @@ -"""Thinkingcleaner integration.""" +"""Support for Thinkingcleaner devices.""" diff --git a/homeassistant/components/thinkingcleaner/sensor.py b/homeassistant/components/thinkingcleaner/sensor.py index 17e2f717f5a..f8462435a45 100644 --- a/homeassistant/components/thinkingcleaner/sensor.py +++ b/homeassistant/components/thinkingcleaner/sensor.py @@ -1,9 +1,4 @@ -""" -Support for ThinkingCleaner. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.thinkingcleaner/ -""" +"""Support for ThinkingCleaner sensors.""" import logging from datetime import timedelta diff --git a/homeassistant/components/thinkingcleaner/switch.py b/homeassistant/components/thinkingcleaner/switch.py index 89586465b43..38a96eb0298 100644 --- a/homeassistant/components/thinkingcleaner/switch.py +++ b/homeassistant/components/thinkingcleaner/switch.py @@ -1,9 +1,4 @@ -""" -Support for ThinkingCleaner. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.thinkingcleaner/ -""" +"""Support for ThinkingCleaner switches.""" import time import logging from datetime import timedelta @@ -45,8 +40,8 @@ def setup_platform(hass, config, add_entities, discovery_info=None): dev = [] for device in devices: for type_name in SWITCH_TYPES: - dev.append(ThinkingCleanerSwitch(device, type_name, - update_devices)) + dev.append(ThinkingCleanerSwitch( + device, type_name, update_devices)) add_entities(dev) diff --git a/homeassistant/components/tibber/__init__.py b/homeassistant/components/tibber/__init__.py index c2d1daa584c..ba9ae43f13b 100644 --- a/homeassistant/components/tibber/__init__.py +++ b/homeassistant/components/tibber/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Tibber. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/tibber/ -""" +"""Support for Tibber.""" import asyncio import logging diff --git a/homeassistant/components/tibber/notify.py b/homeassistant/components/tibber/notify.py index ddbcb3f6c65..6ae22c34209 100644 --- a/homeassistant/components/tibber/notify.py +++ b/homeassistant/components/tibber/notify.py @@ -1,9 +1,4 @@ -""" -Tibber platform for notify component. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/notify.tibber/ -""" +"""Support for Tibber notifications.""" import asyncio import logging @@ -11,7 +6,6 @@ from homeassistant.components.notify import ( ATTR_TITLE, ATTR_TITLE_DEFAULT, BaseNotificationService) from homeassistant.components.tibber import DOMAIN as TIBBER_DOMAIN - _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/tibber/sensor.py b/homeassistant/components/tibber/sensor.py index 1c3ef601633..f3e0c39a1e6 100644 --- a/homeassistant/components/tibber/sensor.py +++ b/homeassistant/components/tibber/sensor.py @@ -1,9 +1,4 @@ -""" -Support for Tibber. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.tibber/ -""" +"""Support for Tibber sensors.""" import asyncio import logging @@ -25,8 +20,8 @@ SCAN_INTERVAL = timedelta(minutes=1) MIN_TIME_BETWEEN_UPDATES = timedelta(minutes=5) -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up the Tibber sensor.""" if discovery_info is None: return diff --git a/homeassistant/components/timer/__init__.py b/homeassistant/components/timer/__init__.py index a4809369d9b..04d9acc06af 100644 --- a/homeassistant/components/timer/__init__.py +++ b/homeassistant/components/timer/__init__.py @@ -1,21 +1,15 @@ -""" -Timer component. - -For more details about this component, please refer to the documentation -at https://home-assistant.io/components/timer/ -""" -import logging +"""Support for Timers.""" from datetime import timedelta +import logging import voluptuous as vol -import homeassistant.util.dt as dt_util +from homeassistant.const import ATTR_ENTITY_ID, CONF_ICON, CONF_NAME import homeassistant.helpers.config_validation as cv -from homeassistant.const import (ATTR_ENTITY_ID, CONF_ICON, CONF_NAME) from homeassistant.helpers.entity_component import EntityComponent from homeassistant.helpers.event import async_track_point_in_utc_time from homeassistant.helpers.restore_state import RestoreEntity - +import homeassistant.util.dt as dt_util _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/toon/__init__.py b/homeassistant/components/toon/__init__.py index 01f170f0b31..96d8b4e6d15 100644 --- a/homeassistant/components/toon/__init__.py +++ b/homeassistant/components/toon/__init__.py @@ -1,9 +1,4 @@ -""" -Toon van Eneco Support. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/toon/ -""" +"""Support for Toon van Eneco devices.""" from datetime import datetime, timedelta import logging diff --git a/homeassistant/components/toon/climate.py b/homeassistant/components/toon/climate.py index 022a509ce06..3397e3dacc2 100644 --- a/homeassistant/components/toon/climate.py +++ b/homeassistant/components/toon/climate.py @@ -1,12 +1,4 @@ -""" -Toon van Eneco Thermostat Support. - -This provides a component for the rebranded Quby thermostat as provided by -Eneco. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/climate.toon/ -""" +"""Support for Toon van Eneco Thermostats.""" from homeassistant.components.climate import ( ATTR_TEMPERATURE, STATE_COOL, STATE_ECO, STATE_HEAT, STATE_AUTO, SUPPORT_OPERATION_MODE, SUPPORT_TARGET_TEMPERATURE, ClimateDevice) diff --git a/homeassistant/components/toon/sensor.py b/homeassistant/components/toon/sensor.py index fb057603a1a..ebd25e02cde 100644 --- a/homeassistant/components/toon/sensor.py +++ b/homeassistant/components/toon/sensor.py @@ -1,9 +1,4 @@ -""" -Component for the rebranded Quby thermostat as provided by Eneco. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.toon/ -""" +"""Support for rebranded Quby thermostat as provided by Eneco.""" import logging import datetime diff --git a/homeassistant/components/toon/switch.py b/homeassistant/components/toon/switch.py index 087ca673e85..08ccec588b4 100644 --- a/homeassistant/components/toon/switch.py +++ b/homeassistant/components/toon/switch.py @@ -1,9 +1,4 @@ -""" -Support for Eneco Slimmer stekkers (Smart Plugs). - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.toon/ -""" +"""Support for Eneco Slimmer stekkers (Smart Plugs).""" import logging from homeassistant.components.switch import SwitchDevice diff --git a/homeassistant/components/tplink_lte/__init__.py b/homeassistant/components/tplink_lte/__init__.py index 3f33cbe9fb3..d0f6e600a0d 100644 --- a/homeassistant/components/tplink_lte/__init__.py +++ b/homeassistant/components/tplink_lte/__init__.py @@ -1,9 +1,4 @@ -""" -Support for TP-Link LTE modems. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/tplink_lte/ -""" +"""Support for TP-Link LTE modems.""" import asyncio import logging @@ -26,7 +21,7 @@ _LOGGER = logging.getLogger(__name__) DOMAIN = 'tplink_lte' DATA_KEY = 'tplink_lte' -CONF_NOTIFY = "notify" +CONF_NOTIFY = 'notify' # Deprecated in 0.88.0, invalidated in 0.91.0, remove in 0.92.0 ATTR_TARGET_INVALIDATION_VERSION = '0.91.0' @@ -49,8 +44,7 @@ CONFIG_SCHEMA = vol.Schema({ DOMAIN: vol.All(cv.ensure_list, [vol.Schema({ vol.Required(CONF_HOST): cv.string, vol.Required(CONF_PASSWORD): cv.string, - vol.Optional(CONF_NOTIFY): - vol.All(cv.ensure_list, [_NOTIFY_SCHEMA]), + vol.Optional(CONF_NOTIFY): vol.All(cv.ensure_list, [_NOTIFY_SCHEMA]), })]) }, extra=vol.ALLOW_EXTRA) diff --git a/homeassistant/components/tplink_lte/notify.py b/homeassistant/components/tplink_lte/notify.py index f80345a4362..519641ed34b 100644 --- a/homeassistant/components/tplink_lte/notify.py +++ b/homeassistant/components/tplink_lte/notify.py @@ -1,9 +1,4 @@ -"""TP-Link LTE platform for notify component. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/notify.tplink_lte/ -""" - +"""Support for TP-Link LTE notifications.""" import logging import attr diff --git a/homeassistant/components/tradfri/__init__.py b/homeassistant/components/tradfri/__init__.py index ba13b8d511a..b14bc811754 100644 --- a/homeassistant/components/tradfri/__init__.py +++ b/homeassistant/components/tradfri/__init__.py @@ -1,9 +1,4 @@ -""" -Support for IKEA Tradfri. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/ikea_tradfri/ -""" +"""Support for IKEA Tradfri.""" import logging import voluptuous as vol @@ -20,6 +15,9 @@ from . import config_flow # noqa pylint_disable=unused-import REQUIREMENTS = ['pytradfri[async]==6.0.1'] +_LOGGER = logging.getLogger(__name__) + + DOMAIN = 'tradfri' CONFIG_FILE = '.tradfri_psk.conf' KEY_GATEWAY = 'tradfri_gateway' @@ -35,8 +33,6 @@ CONFIG_SCHEMA = vol.Schema({ }) }, extra=vol.ALLOW_EXTRA) -_LOGGER = logging.getLogger(__name__) - async def async_setup(hass, config): """Set up the Tradfri component.""" diff --git a/homeassistant/components/tradfri/light.py b/homeassistant/components/tradfri/light.py index 50e92f15e3c..e5e27ecbed1 100644 --- a/homeassistant/components/tradfri/light.py +++ b/homeassistant/components/tradfri/light.py @@ -1,9 +1,4 @@ -""" -Support for the IKEA Tradfri platform. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/light.tradfri/ -""" +"""Support for IKEA Tradfri lights.""" import logging from homeassistant.core import callback diff --git a/homeassistant/components/tradfri/sensor.py b/homeassistant/components/tradfri/sensor.py index 45167874de2..97c7dc9627d 100644 --- a/homeassistant/components/tradfri/sensor.py +++ b/homeassistant/components/tradfri/sensor.py @@ -1,9 +1,4 @@ -""" -Support for the IKEA Tradfri platform. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.tradfri/ -""" +"""Support for IKEA Tradfri sensors.""" import logging from datetime import timedelta diff --git a/homeassistant/components/tradfri/switch.py b/homeassistant/components/tradfri/switch.py index b247858b062..23e6cb20c8f 100644 --- a/homeassistant/components/tradfri/switch.py +++ b/homeassistant/components/tradfri/switch.py @@ -1,9 +1,4 @@ -""" -Support for the IKEA Tradfri platform. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.tradfri/ -""" +"""Support for IKEA Tradfri switches.""" import logging from homeassistant.core import callback diff --git a/homeassistant/components/transmission/__init__.py b/homeassistant/components/transmission/__init__.py index dd10c4ecfdf..25e21dc3d8a 100644 --- a/homeassistant/components/transmission/__init__.py +++ b/homeassistant/components/transmission/__init__.py @@ -1,29 +1,18 @@ -""" -Component for monitoring the Transmission BitTorrent client API. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/transmission/ -""" +"""Support for the Transmission BitTorrent client API.""" from datetime import timedelta - import logging + import voluptuous as vol from homeassistant.const import ( - CONF_HOST, - CONF_MONITORED_CONDITIONS, - CONF_NAME, - CONF_PASSWORD, - CONF_PORT, - CONF_USERNAME, - CONF_SCAN_INTERVAL -) -from homeassistant.helpers import discovery, config_validation as cv + CONF_HOST, CONF_MONITORED_CONDITIONS, CONF_NAME, CONF_PASSWORD, CONF_PORT, + CONF_SCAN_INTERVAL, CONF_USERNAME) +from homeassistant.helpers import config_validation as cv, discovery from homeassistant.helpers.dispatcher import dispatcher_send from homeassistant.helpers.event import track_time_interval - REQUIREMENTS = ['transmissionrpc==0.11'] + _LOGGER = logging.getLogger(__name__) DOMAIN = 'transmission' diff --git a/homeassistant/components/transmission/sensor.py b/homeassistant/components/transmission/sensor.py index cb592a74758..061ed2c0c64 100644 --- a/homeassistant/components/transmission/sensor.py +++ b/homeassistant/components/transmission/sensor.py @@ -1,9 +1,4 @@ -""" -Support for monitoring the Transmission BitTorrent client API. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.transmission/ -""" +"""Support for monitoring the Transmission BitTorrent client API.""" from datetime import timedelta import logging @@ -25,10 +20,7 @@ SCAN_INTERVAL = timedelta(seconds=120) async def async_setup_platform( - hass, - config, - async_add_entities, - discovery_info=None): + hass, config, async_add_entities, discovery_info=None): """Set up the Transmission sensors.""" if discovery_info is None: return @@ -40,11 +32,8 @@ async def async_setup_platform( dev = [] for sensor_type in monitored_variables: dev.append(TransmissionSensor( - sensor_type, - transmission_api, - name, - SENSOR_TYPES[sensor_type][0], - SENSOR_TYPES[sensor_type][1])) + sensor_type, transmission_api, name, + SENSOR_TYPES[sensor_type][0], SENSOR_TYPES[sensor_type][1])) async_add_entities(dev, True) @@ -53,11 +42,7 @@ class TransmissionSensor(Entity): """Representation of a Transmission sensor.""" def __init__( - self, - sensor_type, - transmission_api, - client_name, - sensor_name, + self, sensor_type, transmission_api, client_name, sensor_name, unit_of_measurement): """Initialize the sensor.""" self._name = sensor_name @@ -96,8 +81,7 @@ class TransmissionSensor(Entity): async def async_added_to_hass(self): """Handle entity which will be added.""" async_dispatcher_connect( - self.hass, DATA_UPDATED, self._schedule_immediate_update - ) + self.hass, DATA_UPDATED, self._schedule_immediate_update) @callback def _schedule_immediate_update(self): diff --git a/homeassistant/components/transmission/switch.py b/homeassistant/components/transmission/switch.py index aac946dee8b..373397eddd6 100644 --- a/homeassistant/components/transmission/switch.py +++ b/homeassistant/components/transmission/switch.py @@ -1,9 +1,4 @@ -""" -Support for setting the Transmission BitTorrent client Turtle Mode. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.transmission/ -""" +"""Support for setting the Transmission BitTorrent client Turtle Mode.""" import logging from homeassistant.components.transmission import ( @@ -22,10 +17,7 @@ DEFAULT_NAME = 'Transmission Turtle Mode' async def async_setup_platform( - hass, - config, - async_add_entities, - discovery_info=None): + hass, config, async_add_entities, discovery_info=None): """Set up the Transmission switch.""" if discovery_info is None: return diff --git a/homeassistant/components/tuya/__init__.py b/homeassistant/components/tuya/__init__.py index 22a82dec8e2..117424fd55e 100644 --- a/homeassistant/components/tuya/__init__.py +++ b/homeassistant/components/tuya/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Tuya Smart devices. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/tuya/ -""" +"""Support for Tuya Smart devices.""" from datetime import timedelta import logging import voluptuous as vol diff --git a/homeassistant/components/tuya/climate.py b/homeassistant/components/tuya/climate.py index 4548867a45e..97ff18ba911 100644 --- a/homeassistant/components/tuya/climate.py +++ b/homeassistant/components/tuya/climate.py @@ -1,10 +1,4 @@ -""" -Support for the Tuya climate devices. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/climate.tuya/ -""" - +"""Support for the Tuya climate devices.""" from homeassistant.components.climate import ( ATTR_TEMPERATURE, ENTITY_ID_FORMAT, STATE_AUTO, STATE_COOL, STATE_ECO, STATE_FAN_ONLY, STATE_HEAT, SUPPORT_FAN_MODE, SUPPORT_ON_OFF, diff --git a/homeassistant/components/tuya/cover.py b/homeassistant/components/tuya/cover.py index a3a3db972e9..ac2309cbf9e 100644 --- a/homeassistant/components/tuya/cover.py +++ b/homeassistant/components/tuya/cover.py @@ -1,9 +1,4 @@ -""" -Support for Tuya cover. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/cover.tuya/ -""" +"""Support for Tuya covers.""" from homeassistant.components.cover import ( CoverDevice, ENTITY_ID_FORMAT, SUPPORT_OPEN, SUPPORT_CLOSE, SUPPORT_STOP) from homeassistant.components.tuya import DATA_TUYA, TuyaDevice diff --git a/homeassistant/components/tuya/fan.py b/homeassistant/components/tuya/fan.py index 9cb7cdc3f2c..b6e2cb6950c 100644 --- a/homeassistant/components/tuya/fan.py +++ b/homeassistant/components/tuya/fan.py @@ -1,10 +1,4 @@ -""" -Support for Tuya fans. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/fan.tuya/ -""" - +"""Support for Tuya fans.""" from homeassistant.components.fan import ( ENTITY_ID_FORMAT, FanEntity, SUPPORT_OSCILLATE, SUPPORT_SET_SPEED) from homeassistant.components.tuya import DATA_TUYA, TuyaDevice diff --git a/homeassistant/components/tuya/light.py b/homeassistant/components/tuya/light.py index 0a1468a6a51..1cf2f811872 100644 --- a/homeassistant/components/tuya/light.py +++ b/homeassistant/components/tuya/light.py @@ -1,9 +1,4 @@ -""" -Support for the Tuya light. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/light.tuya/ -""" +"""Support for the Tuya lights.""" from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_HS_COLOR, ENTITY_ID_FORMAT, SUPPORT_BRIGHTNESS, SUPPORT_COLOR_TEMP, SUPPORT_COLOR, Light) diff --git a/homeassistant/components/tuya/scene.py b/homeassistant/components/tuya/scene.py index 2e03e5dba9a..33d207d8545 100644 --- a/homeassistant/components/tuya/scene.py +++ b/homeassistant/components/tuya/scene.py @@ -1,9 +1,4 @@ -""" -Support for the Tuya scene. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/scene.tuya/ -""" +"""Support for the Tuya scenes.""" from homeassistant.components.scene import Scene, DOMAIN from homeassistant.components.tuya import DATA_TUYA, TuyaDevice diff --git a/homeassistant/components/tuya/switch.py b/homeassistant/components/tuya/switch.py index 9fc1f92016e..1e8fab2cc1b 100644 --- a/homeassistant/components/tuya/switch.py +++ b/homeassistant/components/tuya/switch.py @@ -1,9 +1,4 @@ -""" -Support for Tuya switch. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.tuya/ -""" +"""Support for Tuya switches.""" from homeassistant.components.switch import ENTITY_ID_FORMAT, SwitchDevice from homeassistant.components.tuya import DATA_TUYA, TuyaDevice diff --git a/homeassistant/components/twilio/__init__.py b/homeassistant/components/twilio/__init__.py index 9fcba4da817..ce8c272165f 100644 --- a/homeassistant/components/twilio/__init__.py +++ b/homeassistant/components/twilio/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Twilio. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/twilio/ -""" +"""Support for Twilio.""" import voluptuous as vol import homeassistant.helpers.config_validation as cv diff --git a/homeassistant/components/unifi/__init__.py b/homeassistant/components/unifi/__init__.py index 8476aade7d7..7e236789a5c 100644 --- a/homeassistant/components/unifi/__init__.py +++ b/homeassistant/components/unifi/__init__.py @@ -1,10 +1,4 @@ -""" -Support for devices connected to UniFi POE. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/unifi/ -""" - +"""Support for devices connected to UniFi POE.""" import voluptuous as vol from homeassistant import config_entries diff --git a/homeassistant/components/unifi/const.py b/homeassistant/components/unifi/const.py index 7250feec799..8fe90823c49 100644 --- a/homeassistant/components/unifi/const.py +++ b/homeassistant/components/unifi/const.py @@ -1,5 +1,4 @@ """Constants for the UniFi component.""" - import logging LOGGER = logging.getLogger('homeassistant.components.unifi') diff --git a/homeassistant/components/unifi/controller.py b/homeassistant/components/unifi/controller.py index 11529cbe171..abd102f6187 100644 --- a/homeassistant/components/unifi/controller.py +++ b/homeassistant/components/unifi/controller.py @@ -1,5 +1,4 @@ """UniFi Controller abstraction.""" - import asyncio import async_timeout diff --git a/homeassistant/components/unifi/switch.py b/homeassistant/components/unifi/switch.py index c1f8a96946f..425b9878f6d 100644 --- a/homeassistant/components/unifi/switch.py +++ b/homeassistant/components/unifi/switch.py @@ -1,10 +1,4 @@ -""" -Support for devices connected to UniFi POE. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.unifi/ -""" - +"""Support for devices connected to UniFi POE.""" import asyncio import logging @@ -39,7 +33,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities): """ controller_id = CONTROLLER_ID.format( host=config_entry.data[CONF_CONTROLLER][CONF_HOST], - site=config_entry.data[CONF_CONTROLLER][CONF_SITE_ID] + site=config_entry.data[CONF_CONTROLLER][CONF_SITE_ID], ) controller = hass.data[unifi.DOMAIN][controller_id] switches = {} diff --git a/homeassistant/components/upcloud/__init__.py b/homeassistant/components/upcloud/__init__.py index ca0f554bd39..7981cf948bb 100644 --- a/homeassistant/components/upcloud/__init__.py +++ b/homeassistant/components/upcloud/__init__.py @@ -1,9 +1,4 @@ -""" -Support for UpCloud. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/upcloud/ -""" +"""Support for UpCloud.""" import logging from datetime import timedelta @@ -43,12 +38,12 @@ UPCLOUD_PLATFORMS = ['binary_sensor', 'switch'] SCAN_INTERVAL = timedelta(seconds=60) -SIGNAL_UPDATE_UPCLOUD = "upcloud_update" +SIGNAL_UPDATE_UPCLOUD = 'upcloud_update' STATE_MAP = { - "started": STATE_ON, - "stopped": STATE_OFF, - "error": STATE_PROBLEM, + 'error': STATE_PROBLEM, + 'started': STATE_ON, + 'stopped': STATE_OFF, } CONFIG_SCHEMA = vol.Schema({ diff --git a/homeassistant/components/upcloud/binary_sensor.py b/homeassistant/components/upcloud/binary_sensor.py index c7b8a284dc9..3fd54b349a2 100644 --- a/homeassistant/components/upcloud/binary_sensor.py +++ b/homeassistant/components/upcloud/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for monitoring the state of UpCloud servers. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.upcloud/ -""" +"""Support for monitoring the state of UpCloud servers.""" import logging import voluptuous as vol diff --git a/homeassistant/components/upcloud/switch.py b/homeassistant/components/upcloud/switch.py index f2818e59a9b..0b44d787f6f 100644 --- a/homeassistant/components/upcloud/switch.py +++ b/homeassistant/components/upcloud/switch.py @@ -1,9 +1,4 @@ -""" -Support for interacting with UpCloud servers. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/switch.upcloud/ -""" +"""Support for interacting with UpCloud servers.""" import logging import voluptuous as vol diff --git a/homeassistant/components/updater/__init__.py b/homeassistant/components/updater/__init__.py index 28c88bf5c29..cb2646ea942 100644 --- a/homeassistant/components/updater/__init__.py +++ b/homeassistant/components/updater/__init__.py @@ -1,9 +1,4 @@ -""" -Support to check for available updates. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/updater/ -""" +"""Support to check for available updates.""" import asyncio from datetime import timedelta # pylint: disable=import-error,no-name-in-module diff --git a/homeassistant/components/upnp/__init__.py b/homeassistant/components/upnp/__init__.py index 2a1b8c52d79..efa3ee73af8 100644 --- a/homeassistant/components/upnp/__init__.py +++ b/homeassistant/components/upnp/__init__.py @@ -1,9 +1,4 @@ -""" -Will open a port in your router for Home Assistant and provide statistics. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/upnp/ -""" +"""Open ports in your router for Home Assistant and provide statistics.""" from ipaddress import ip_address import voluptuous as vol @@ -28,7 +23,6 @@ from .const import DOMAIN from .const import LOGGER as _LOGGER from .device import Device - REQUIREMENTS = ['async-upnp-client==0.14.4'] NOTIFICATION_ID = 'upnp_notification' @@ -41,8 +35,7 @@ CONFIG_SCHEMA = vol.Schema({ vol.Optional(CONF_LOCAL_IP): vol.All(ip_address, cv.string), vol.Optional(CONF_PORTS): vol.Schema({ - vol.Any(CONF_HASS, cv.port): - vol.Any(CONF_HASS, cv.port) + vol.Any(CONF_HASS, cv.port): vol.Any(CONF_HASS, cv.port) }) }), }, extra=vol.ALLOW_EXTRA) diff --git a/homeassistant/components/usps/__init__.py b/homeassistant/components/usps/__init__.py index 41aa240492b..8a7d7d52255 100644 --- a/homeassistant/components/usps/__init__.py +++ b/homeassistant/components/usps/__init__.py @@ -1,9 +1,4 @@ -""" -Support for USPS packages and mail. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/usps/ -""" +"""Support for USPS packages and mail.""" from datetime import timedelta import logging @@ -33,7 +28,7 @@ CONFIG_SCHEMA = vol.Schema({ vol.Required(CONF_USERNAME): cv.string, vol.Required(CONF_PASSWORD): cv.string, vol.Optional(CONF_NAME, default=DOMAIN): cv.string, - vol.Optional(CONF_DRIVER): cv.string + vol.Optional(CONF_DRIVER): cv.string, }), }, extra=vol.ALLOW_EXTRA) diff --git a/homeassistant/components/usps/camera.py b/homeassistant/components/usps/camera.py index d23359d8c57..d4769102d14 100644 --- a/homeassistant/components/usps/camera.py +++ b/homeassistant/components/usps/camera.py @@ -1,9 +1,4 @@ -""" -Support for a camera made up of usps mail images. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/camera.usps/ -""" +"""Support for a camera made up of USPS mail images.""" from datetime import timedelta import logging diff --git a/homeassistant/components/usps/sensor.py b/homeassistant/components/usps/sensor.py index 17fa11fe8d3..1603715861d 100644 --- a/homeassistant/components/usps/sensor.py +++ b/homeassistant/components/usps/sensor.py @@ -1,9 +1,4 @@ -""" -Sensor for USPS packages. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.usps/ -""" +"""Sensor for USPS packages.""" from collections import defaultdict import logging diff --git a/homeassistant/components/utility_meter/__init__.py b/homeassistant/components/utility_meter/__init__.py index 8a8e669ba88..7d8e4ddf71b 100644 --- a/homeassistant/components/utility_meter/__init__.py +++ b/homeassistant/components/utility_meter/__init__.py @@ -1,10 +1,4 @@ -""" -Component to track utility consumption over given periods of time. - -For more details about this component, please refer to the documentation -at https://www.home-assistant.io/components/utility_meter/ -""" - +"""Support for tracking consumption over given periods of time.""" import logging import voluptuous as vol @@ -25,7 +19,7 @@ from .const import ( _LOGGER = logging.getLogger(__name__) -TARIFF_ICON = "mdi:clock-outline" +TARIFF_ICON = 'mdi:clock-outline' ATTR_TARIFFS = 'tariffs' diff --git a/homeassistant/components/utility_meter/sensor.py b/homeassistant/components/utility_meter/sensor.py index cd86f9c0bd0..d3edf7d501b 100644 --- a/homeassistant/components/utility_meter/sensor.py +++ b/homeassistant/components/utility_meter/sensor.py @@ -1,9 +1,4 @@ -""" -Utility meter from sensors providing raw data. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.utility_meter/ -""" +"""Utility meter from sensors providing raw data.""" import logging from decimal import Decimal, DecimalException @@ -40,8 +35,8 @@ PAUSED = 'paused' COLLECTING = 'collecting' -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up the utility meter sensor.""" if discovery_info is None: _LOGGER.error("This platform is only available through discovery") @@ -56,12 +51,10 @@ async def async_setup_platform(hass, config, async_add_entities, conf_meter_tariff_entity = hass.data[DATA_UTILITY][meter].get( CONF_TARIFF_ENTITY) - meters.append(UtilityMeterSensor(conf_meter_source, - conf.get(CONF_NAME), - conf_meter_type, - conf_meter_offset, - conf.get(CONF_TARIFF), - conf_meter_tariff_entity)) + meters.append(UtilityMeterSensor( + conf_meter_source, conf.get(CONF_NAME), conf_meter_type, + conf_meter_offset, conf.get(CONF_TARIFF), + conf_meter_tariff_entity)) async_add_entities(meters) @@ -181,16 +174,16 @@ class UtilityMeterSensor(RestoreEntity): self._last_reset = state.attributes.get(ATTR_LAST_RESET) await self.async_update_ha_state() if state.attributes.get(ATTR_STATUS) == PAUSED: - # Fake cancelation function to init the meter paused + # Fake cancellation function to init the meter paused self._collecting = lambda: None @callback def async_source_tracking(event): """Wait for source to be ready, then start meter.""" if self._tariff_entity is not None: - _LOGGER.debug("track %s", self._tariff_entity) - async_track_state_change(self.hass, self._tariff_entity, - self.async_tariff_change) + _LOGGER.debug("Track %s", self._tariff_entity) + async_track_state_change( + self.hass, self._tariff_entity, self.async_tariff_change) tariff_entity_state = self.hass.states.get(self._tariff_entity) if self._tariff != tariff_entity_state.state: diff --git a/homeassistant/components/velbus/__init__.py b/homeassistant/components/velbus/__init__.py index 15ca8584a4e..38d8b6c3f1c 100644 --- a/homeassistant/components/velbus/__init__.py +++ b/homeassistant/components/velbus/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Velbus platform. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/velbus/ -""" +"""Support for Velbus devices.""" import logging import voluptuous as vol @@ -18,7 +13,6 @@ _LOGGER = logging.getLogger(__name__) DOMAIN = 'velbus' - VELBUS_MESSAGE = 'velbus.message' CONFIG_SCHEMA = vol.Schema({ diff --git a/homeassistant/components/velbus/binary_sensor.py b/homeassistant/components/velbus/binary_sensor.py index b123b958560..43ffa232b40 100644 --- a/homeassistant/components/velbus/binary_sensor.py +++ b/homeassistant/components/velbus/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for Velbus Binary Sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.velbus/ -""" +"""Support for Velbus Binary Sensors.""" import logging from homeassistant.components.binary_sensor import BinarySensorDevice @@ -15,8 +10,8 @@ _LOGGER = logging.getLogger(__name__) DEPENDENCIES = ['velbus'] -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up Velbus binary sensors.""" if discovery_info is None: return diff --git a/homeassistant/components/velbus/climate.py b/homeassistant/components/velbus/climate.py index 0b0205acefb..ae7a2828492 100644 --- a/homeassistant/components/velbus/climate.py +++ b/homeassistant/components/velbus/climate.py @@ -1,9 +1,4 @@ -""" -Support for Velbus thermostat. - -For more details about this platform, please refer to the documentation -https://home-assistant.io/components/climate.velbus/ -""" +"""Support for Velbus thermostat.""" import logging from homeassistant.components.climate import ( diff --git a/homeassistant/components/velbus/cover.py b/homeassistant/components/velbus/cover.py index 7e5099cecf8..72a5a7af79b 100644 --- a/homeassistant/components/velbus/cover.py +++ b/homeassistant/components/velbus/cover.py @@ -1,9 +1,4 @@ -""" -Support for Velbus covers. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/cover.velbus/ -""" +"""Support for Velbus covers.""" import logging import time diff --git a/homeassistant/components/velbus/sensor.py b/homeassistant/components/velbus/sensor.py index 8e9aafd3605..10ad89ab847 100644 --- a/homeassistant/components/velbus/sensor.py +++ b/homeassistant/components/velbus/sensor.py @@ -1,9 +1,4 @@ -""" -Velbus sensors. - -For more details about this platform, please refer to the documentation -https://home-assistant.io/components/sensor.velbus/ -""" +"""Support for Velbus sensors.""" import logging from homeassistant.components.velbus import ( @@ -14,8 +9,8 @@ _LOGGER = logging.getLogger(__name__) DEPENDENCIES = ['velbus'] -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up the Velbus temp sensor platform.""" if discovery_info is None: return diff --git a/homeassistant/components/velbus/switch.py b/homeassistant/components/velbus/switch.py index 300ff43d676..7104bb0750d 100644 --- a/homeassistant/components/velbus/switch.py +++ b/homeassistant/components/velbus/switch.py @@ -1,9 +1,4 @@ -""" -Support for Velbus switches. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.velbus/ -""" +"""Support for Velbus switches.""" import logging from homeassistant.components.switch import SwitchDevice @@ -15,8 +10,8 @@ _LOGGER = logging.getLogger(__name__) DEPENDENCIES = ['velbus'] -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up the Velbus Switch platform.""" if discovery_info is None: return diff --git a/homeassistant/components/velux/__init__.py b/homeassistant/components/velux/__init__.py index 010612acc7d..1018f72fdbc 100644 --- a/homeassistant/components/velux/__init__.py +++ b/homeassistant/components/velux/__init__.py @@ -1,9 +1,4 @@ -""" -Connects to VELUX KLF 200 interface. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/velux/ -""" +"""Support for VELUX KLF 200 devices.""" import logging import voluptuous as vol diff --git a/homeassistant/components/velux/cover.py b/homeassistant/components/velux/cover.py index b78d981c695..1c3192961af 100644 --- a/homeassistant/components/velux/cover.py +++ b/homeassistant/components/velux/cover.py @@ -1,10 +1,4 @@ -""" -Support for Velux covers. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/cover.velux/ -""" - +"""Support for Velux covers.""" from homeassistant.components.cover import ( ATTR_POSITION, SUPPORT_CLOSE, SUPPORT_OPEN, SUPPORT_SET_POSITION, SUPPORT_STOP, CoverDevice) @@ -14,8 +8,8 @@ from homeassistant.core import callback DEPENDENCIES = ['velux'] -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up cover(s) for Velux platform.""" entities = [] for node in hass.data[DATA_VELUX].pyvlx.nodes: diff --git a/homeassistant/components/velux/scene.py b/homeassistant/components/velux/scene.py index 77ba30158e4..db1e9450daf 100644 --- a/homeassistant/components/velux/scene.py +++ b/homeassistant/components/velux/scene.py @@ -1,20 +1,13 @@ -""" -Support for VELUX scenes. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/scene.velux/ -""" - +"""Support for VELUX scenes.""" from homeassistant.components.scene import Scene from homeassistant.components.velux import _LOGGER, DATA_VELUX - DEPENDENCIES = ['velux'] -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): - """Set up the scenes for velux platform.""" +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): + """Set up the scenes for Velux platform.""" entities = [] for scene in hass.data[DATA_VELUX].pyvlx.scenes: entities.append(VeluxScene(scene)) @@ -22,11 +15,11 @@ async def async_setup_platform(hass, config, async_add_entities, class VeluxScene(Scene): - """Representation of a velux scene.""" + """Representation of a Velux scene.""" def __init__(self, scene): """Init velux scene.""" - _LOGGER.info("Adding VELUX scene: %s", scene) + _LOGGER.info("Adding Velux scene: %s", scene) self.scene = scene @property diff --git a/homeassistant/components/vera/__init__.py b/homeassistant/components/vera/__init__.py index 127cd008a3a..3f4c66d238a 100644 --- a/homeassistant/components/vera/__init__.py +++ b/homeassistant/components/vera/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Vera devices. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/vera/ -""" +"""Support for Vera devices.""" import logging from collections import defaultdict @@ -43,7 +38,7 @@ CONFIG_SCHEMA = vol.Schema({ DOMAIN: vol.Schema({ vol.Required(CONF_CONTROLLER): cv.url, vol.Optional(CONF_EXCLUDE, default=[]): VERA_ID_LIST_SCHEMA, - vol.Optional(CONF_LIGHTS, default=[]): VERA_ID_LIST_SCHEMA + vol.Optional(CONF_LIGHTS, default=[]): VERA_ID_LIST_SCHEMA, }), }, extra=vol.ALLOW_EXTRA) diff --git a/homeassistant/components/vera/binary_sensor.py b/homeassistant/components/vera/binary_sensor.py index bb1e7331de8..837422dbc7c 100644 --- a/homeassistant/components/vera/binary_sensor.py +++ b/homeassistant/components/vera/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for Vera binary sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.vera/ -""" +"""Support for Vera binary sensors.""" import logging from homeassistant.components.binary_sensor import ( diff --git a/homeassistant/components/vera/climate.py b/homeassistant/components/vera/climate.py index 5e016b8666b..7cd3129bc14 100644 --- a/homeassistant/components/vera/climate.py +++ b/homeassistant/components/vera/climate.py @@ -1,9 +1,4 @@ -""" -Support for Vera thermostats. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.vera/ -""" +"""Support for Vera thermostats.""" import logging from homeassistant.util import convert diff --git a/homeassistant/components/vera/cover.py b/homeassistant/components/vera/cover.py index 279e4a4307d..1168cca8425 100644 --- a/homeassistant/components/vera/cover.py +++ b/homeassistant/components/vera/cover.py @@ -1,9 +1,4 @@ -""" -Support for Vera cover - curtains, rollershutters etc. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/cover.vera/ -""" +"""Support for Vera cover - curtains, rollershutters etc.""" import logging from homeassistant.components.cover import CoverDevice, ENTITY_ID_FORMAT, \ diff --git a/homeassistant/components/vera/light.py b/homeassistant/components/vera/light.py index 702236ac748..93e54b915c7 100644 --- a/homeassistant/components/vera/light.py +++ b/homeassistant/components/vera/light.py @@ -1,9 +1,4 @@ -""" -Support for Vera lights. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/light.vera/ -""" +"""Support for Vera lights.""" import logging from homeassistant.components.light import ( diff --git a/homeassistant/components/vera/lock.py b/homeassistant/components/vera/lock.py index 21287b6328e..61d5f0baf28 100644 --- a/homeassistant/components/vera/lock.py +++ b/homeassistant/components/vera/lock.py @@ -1,9 +1,4 @@ -""" -Support for Vera locks. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/lock.vera/ -""" +"""Support for Vera locks.""" import logging from homeassistant.components.lock import ENTITY_ID_FORMAT, LockDevice diff --git a/homeassistant/components/vera/scene.py b/homeassistant/components/vera/scene.py index 6cae1195f87..0960512f6d1 100644 --- a/homeassistant/components/vera/scene.py +++ b/homeassistant/components/vera/scene.py @@ -1,9 +1,4 @@ -""" -Support for Vera scenes. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/scene.vera/ -""" +"""Support for Vera scenes.""" import logging from homeassistant.util import slugify @@ -11,10 +6,10 @@ from homeassistant.components.scene import Scene from homeassistant.components.vera import ( VERA_CONTROLLER, VERA_SCENES, VERA_ID_FORMAT) -DEPENDENCIES = ['vera'] - _LOGGER = logging.getLogger(__name__) +DEPENDENCIES = ['vera'] + def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Vera scenes.""" diff --git a/homeassistant/components/vera/sensor.py b/homeassistant/components/vera/sensor.py index c9b5a36afa3..8b68cc9190f 100644 --- a/homeassistant/components/vera/sensor.py +++ b/homeassistant/components/vera/sensor.py @@ -1,9 +1,4 @@ -""" -Support for Vera sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.vera/ -""" +"""Support for Vera sensors.""" import logging from datetime import timedelta @@ -15,10 +10,10 @@ from homeassistant.util import convert from homeassistant.components.vera import ( VERA_CONTROLLER, VERA_DEVICES, VeraDevice) -DEPENDENCIES = ['vera'] - _LOGGER = logging.getLogger(__name__) +DEPENDENCIES = ['vera'] + SCAN_INTERVAL = timedelta(seconds=5) diff --git a/homeassistant/components/vera/switch.py b/homeassistant/components/vera/switch.py index 4742b755944..2f4d18e34e1 100644 --- a/homeassistant/components/vera/switch.py +++ b/homeassistant/components/vera/switch.py @@ -1,9 +1,4 @@ -""" -Support for Vera switches. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.vera/ -""" +"""Support for Vera switches.""" import logging from homeassistant.util import convert @@ -11,10 +6,10 @@ from homeassistant.components.switch import ENTITY_ID_FORMAT, SwitchDevice from homeassistant.components.vera import ( VERA_CONTROLLER, VERA_DEVICES, VeraDevice) -DEPENDENCIES = ['vera'] - _LOGGER = logging.getLogger(__name__) +DEPENDENCIES = ['vera'] + def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Vera switches.""" diff --git a/homeassistant/components/verisure/__init__.py b/homeassistant/components/verisure/__init__.py index 481aa331e41..393a4066002 100644 --- a/homeassistant/components/verisure/__init__.py +++ b/homeassistant/components/verisure/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Verisure components. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/verisure/ -""" +"""Support for Verisure devices.""" import logging import threading from datetime import timedelta diff --git a/homeassistant/components/verisure/alarm_control_panel.py b/homeassistant/components/verisure/alarm_control_panel.py index 160f152ef8a..adcdcd668cb 100644 --- a/homeassistant/components/verisure/alarm_control_panel.py +++ b/homeassistant/components/verisure/alarm_control_panel.py @@ -1,9 +1,4 @@ -""" -Interfaces with Verisure alarm control panel. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/alarm_control_panel.verisure/ -""" +"""Support for Verisure alarm control panels.""" import logging from time import sleep diff --git a/homeassistant/components/verisure/binary_sensor.py b/homeassistant/components/verisure/binary_sensor.py index e040da959ea..4c9e79724fe 100644 --- a/homeassistant/components/verisure/binary_sensor.py +++ b/homeassistant/components/verisure/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Interfaces with Verisure sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.verisure/ -""" +"""Support for Verisure binary sensors.""" import logging from homeassistant.components.binary_sensor import BinarySensorDevice diff --git a/homeassistant/components/verisure/camera.py b/homeassistant/components/verisure/camera.py index 01e4e82f3bc..7112e535a95 100644 --- a/homeassistant/components/verisure/camera.py +++ b/homeassistant/components/verisure/camera.py @@ -1,9 +1,4 @@ -""" -Camera that loads a picture from a local file. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/camera.verisure/ -""" +"""Support for Verisure cameras.""" import errno import logging import os diff --git a/homeassistant/components/verisure/lock.py b/homeassistant/components/verisure/lock.py index be9a0a24fee..cdd230ea7f7 100644 --- a/homeassistant/components/verisure/lock.py +++ b/homeassistant/components/verisure/lock.py @@ -1,9 +1,4 @@ -""" -Interfaces with Verisure locks. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/verisure/ -""" +"""Support for Verisure locks.""" import logging from time import sleep from time import time @@ -18,7 +13,7 @@ _LOGGER = logging.getLogger(__name__) def setup_platform(hass, config, add_entities, discovery_info=None): - """Set up the Verisure platform.""" + """Set up the Verisure lock platform.""" locks = [] if int(hub.config.get(CONF_LOCKS, 1)): hub.update_overview() diff --git a/homeassistant/components/verisure/sensor.py b/homeassistant/components/verisure/sensor.py index b6ea75ae8cc..13706d8408f 100644 --- a/homeassistant/components/verisure/sensor.py +++ b/homeassistant/components/verisure/sensor.py @@ -1,9 +1,4 @@ -""" -Interfaces with Verisure sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.verisure/ -""" +"""Support for Verisure sensors.""" import logging from homeassistant.components.verisure import HUB as hub diff --git a/homeassistant/components/verisure/switch.py b/homeassistant/components/verisure/switch.py index 11ccd82696e..a418eec6bc5 100644 --- a/homeassistant/components/verisure/switch.py +++ b/homeassistant/components/verisure/switch.py @@ -1,9 +1,4 @@ -""" -Support for Verisure Smartplugs. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.verisure/ -""" +"""Support for Verisure Smartplugs.""" import logging from time import time diff --git a/homeassistant/components/volvooncall/__init__.py b/homeassistant/components/volvooncall/__init__.py index 0d89537b8e8..9dbaadf9bee 100644 --- a/homeassistant/components/volvooncall/__init__.py +++ b/homeassistant/components/volvooncall/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Volvo On Call. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/volvooncall/ -""" +"""Support for Volvo On Call.""" from datetime import timedelta import logging @@ -45,7 +40,7 @@ COMPONENTS = { 'binary_sensor': 'binary_sensor', 'lock': 'lock', 'device_tracker': 'device_tracker', - 'switch': 'switch' + 'switch': 'switch', } RESOURCES = [ diff --git a/homeassistant/components/volvooncall/binary_sensor.py b/homeassistant/components/volvooncall/binary_sensor.py index e7092ff16d5..7158e4df69b 100644 --- a/homeassistant/components/volvooncall/binary_sensor.py +++ b/homeassistant/components/volvooncall/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for VOC. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.volvooncall/ -""" +"""Support for VOC.""" import logging from homeassistant.components.volvooncall import VolvoEntity, DATA_KEY @@ -13,8 +8,8 @@ from homeassistant.components.binary_sensor import ( _LOGGER = logging.getLogger(__name__) -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up the Volvo sensors.""" if discovery_info is None: return diff --git a/homeassistant/components/volvooncall/device_tracker.py b/homeassistant/components/volvooncall/device_tracker.py index 395b539a065..d4838c01505 100644 --- a/homeassistant/components/volvooncall/device_tracker.py +++ b/homeassistant/components/volvooncall/device_tracker.py @@ -1,9 +1,4 @@ -""" -Support for tracking a Volvo. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/device_tracker.volvooncall/ -""" +"""Support for tracking a Volvo.""" import logging from homeassistant.util import slugify diff --git a/homeassistant/components/volvooncall/lock.py b/homeassistant/components/volvooncall/lock.py index 83301aa3d4e..f281ea64461 100644 --- a/homeassistant/components/volvooncall/lock.py +++ b/homeassistant/components/volvooncall/lock.py @@ -1,9 +1,4 @@ -""" -Support for Volvo On Call locks. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/lock.volvooncall/ -""" +"""Support for Volvo On Call locks.""" import logging from homeassistant.components.lock import LockDevice @@ -12,8 +7,8 @@ from homeassistant.components.volvooncall import VolvoEntity, DATA_KEY _LOGGER = logging.getLogger(__name__) -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up the Volvo On Call lock.""" if discovery_info is None: return diff --git a/homeassistant/components/volvooncall/sensor.py b/homeassistant/components/volvooncall/sensor.py index 65b996a5bd5..07f16e580bd 100644 --- a/homeassistant/components/volvooncall/sensor.py +++ b/homeassistant/components/volvooncall/sensor.py @@ -1,10 +1,4 @@ -""" -Support for VOC. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.volvooncall/ - -""" +"""Support for Volvo On Call sensors.""" import logging from homeassistant.components.volvooncall import VolvoEntity, DATA_KEY @@ -12,8 +6,8 @@ from homeassistant.components.volvooncall import VolvoEntity, DATA_KEY _LOGGER = logging.getLogger(__name__) -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up the Volvo sensors.""" if discovery_info is None: return diff --git a/homeassistant/components/volvooncall/switch.py b/homeassistant/components/volvooncall/switch.py index 81abf7d0e6c..d3985557cff 100644 --- a/homeassistant/components/volvooncall/switch.py +++ b/homeassistant/components/volvooncall/switch.py @@ -1,11 +1,4 @@ -""" -Support for Volvo heater. - -This platform uses the Volvo online service. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.volvooncall/ -""" +"""Support for Volvo heater.""" import logging from homeassistant.components.volvooncall import VolvoEntity, DATA_KEY @@ -14,8 +7,8 @@ from homeassistant.helpers.entity import ToggleEntity _LOGGER = logging.getLogger(__name__) -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up a Volvo switch.""" if discovery_info is None: return diff --git a/homeassistant/components/vultr/__init__.py b/homeassistant/components/vultr/__init__.py index b28189444ee..9f2efabd412 100644 --- a/homeassistant/components/vultr/__init__.py +++ b/homeassistant/components/vultr/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Vultr. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/vultr/ -""" +"""Support for Vultr.""" import logging from datetime import timedelta diff --git a/homeassistant/components/w800rf32/__init__.py b/homeassistant/components/w800rf32/__init__.py index 4b237272546..d2c0cf6b968 100644 --- a/homeassistant/components/w800rf32/__init__.py +++ b/homeassistant/components/w800rf32/__init__.py @@ -1,10 +1,4 @@ -""" -Support for w800rf32 components. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/w800rf32/ - -""" +"""Support for w800rf32 devices.""" import logging import voluptuous as vol @@ -18,15 +12,16 @@ from homeassistant.helpers.dispatcher import (dispatcher_send) REQUIREMENTS = ['pyW800rf32==0.1'] -DOMAIN = 'w800rf32' DATA_W800RF32 = 'data_w800rf32' +DOMAIN = 'w800rf32' + W800RF32_DEVICE = 'w800rf32_{}' _LOGGER = logging.getLogger(__name__) CONFIG_SCHEMA = vol.Schema({ DOMAIN: vol.Schema({ - vol.Required(CONF_DEVICE): cv.string + vol.Required(CONF_DEVICE): cv.string, }), }, extra=vol.ALLOW_EXTRA) diff --git a/homeassistant/components/w800rf32/binary_sensor.py b/homeassistant/components/w800rf32/binary_sensor.py index 48ac6f41a12..855a5f3ed0a 100644 --- a/homeassistant/components/w800rf32/binary_sensor.py +++ b/homeassistant/components/w800rf32/binary_sensor.py @@ -1,10 +1,4 @@ -""" -Support for w800rf32 binary sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.w800rf32/ - -""" +"""Support for w800rf32 binary sensors.""" import logging import voluptuous as vol @@ -30,14 +24,14 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ vol.Optional(CONF_NAME): cv.string, vol.Optional(CONF_DEVICE_CLASS): DEVICE_CLASSES_SCHEMA, vol.Optional(CONF_OFF_DELAY): - vol.All(cv.time_period, cv.positive_timedelta) + vol.All(cv.time_period, cv.positive_timedelta), }) }, }, extra=vol.ALLOW_EXTRA) -async def async_setup_platform(hass, config, - add_entities, discovery_info=None): +async def async_setup_platform( + hass, config, add_entities, discovery_info=None): """Set up the Binary Sensor platform to w800rf32.""" binary_sensors = [] # device_id --> "c1 or a3" X10 device. entity (type dictionary) diff --git a/homeassistant/components/wake_on_lan/__init__.py b/homeassistant/components/wake_on_lan/__init__.py index dba99bf7e3d..e6e12ef0afe 100644 --- a/homeassistant/components/wake_on_lan/__init__.py +++ b/homeassistant/components/wake_on_lan/__init__.py @@ -1,9 +1,4 @@ -""" -Component to wake up devices sending Wake-On-LAN magic packets. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/wake_on_lan/ -""" +"""Support for sending Wake-On-LAN magic packets.""" from functools import partial import logging diff --git a/homeassistant/components/water_heater/__init__.py b/homeassistant/components/water_heater/__init__.py index 07acb15b765..6c3cc7405ba 100644 --- a/homeassistant/components/water_heater/__init__.py +++ b/homeassistant/components/water_heater/__init__.py @@ -1,9 +1,4 @@ -""" -Provides functionality to interact with water heater devices. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/water_heater/ -""" +"""Support for water heater devices.""" from datetime import timedelta import logging import functools as ft diff --git a/homeassistant/components/water_heater/demo.py b/homeassistant/components/water_heater/demo.py index 89b86c12af4..a0220927f16 100644 --- a/homeassistant/components/water_heater/demo.py +++ b/homeassistant/components/water_heater/demo.py @@ -1,9 +1,4 @@ -""" -Demo platform that offers a fake water_heater device. - -For more details about this platform, please refer to the documentation -https://home-assistant.io/components/demo/ -""" +"""Demo platform that offers a fake water_heater device.""" from homeassistant.components.water_heater import ( WaterHeaterDevice, SUPPORT_TARGET_TEMPERATURE, @@ -18,11 +13,10 @@ SUPPORT_FLAGS_HEATER = (SUPPORT_TARGET_TEMPERATURE | SUPPORT_OPERATION_MODE | def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Demo water_heater devices.""" add_entities([ - DemoWaterHeater('Demo Water Heater', 119, - TEMP_FAHRENHEIT, False, 'eco'), - DemoWaterHeater('Demo Water Heater Celsius', 45, - TEMP_CELSIUS, True, 'eco') - + DemoWaterHeater( + 'Demo Water Heater', 119, TEMP_FAHRENHEIT, False, 'eco'), + DemoWaterHeater( + 'Demo Water Heater Celsius', 45, TEMP_CELSIUS, True, 'eco'), ]) diff --git a/homeassistant/components/water_heater/econet.py b/homeassistant/components/water_heater/econet.py index 6af8ea43fa6..93ae98ed94b 100644 --- a/homeassistant/components/water_heater/econet.py +++ b/homeassistant/components/water_heater/econet.py @@ -1,9 +1,4 @@ -""" -Support for Rheem EcoNet water heaters. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/water_heater.econet/ -""" +"""Support for Rheem EcoNet water heaters.""" import datetime import logging diff --git a/homeassistant/components/waterfurnace/__init__.py b/homeassistant/components/waterfurnace/__init__.py index bbae6170048..38fd44cd1c7 100644 --- a/homeassistant/components/waterfurnace/__init__.py +++ b/homeassistant/components/waterfurnace/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Waterfurnace component. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/waterfurnace/ -""" +"""Support for Waterfurnaces.""" from datetime import timedelta import logging import time @@ -18,12 +13,11 @@ from homeassistant.core import callback from homeassistant.helpers import config_validation as cv from homeassistant.helpers import discovery - -REQUIREMENTS = ["waterfurnace==1.1.0"] +REQUIREMENTS = ['waterfurnace==1.1.0'] _LOGGER = logging.getLogger(__name__) -DOMAIN = "waterfurnace" +DOMAIN = 'waterfurnace' UPDATE_TOPIC = DOMAIN + "_update" SCAN_INTERVAL = timedelta(seconds=10) ERROR_INTERVAL = timedelta(seconds=300) @@ -35,7 +29,7 @@ NOTIFICATION_TITLE = 'WaterFurnace website status' CONFIG_SCHEMA = vol.Schema({ DOMAIN: vol.Schema({ vol.Required(CONF_PASSWORD): cv.string, - vol.Required(CONF_USERNAME): cv.string + vol.Required(CONF_USERNAME): cv.string, }), }, extra=vol.ALLOW_EXTRA) diff --git a/homeassistant/components/watson_iot/__init__.py b/homeassistant/components/watson_iot/__init__.py index 889984eb223..e9a907ee6d2 100644 --- a/homeassistant/components/watson_iot/__init__.py +++ b/homeassistant/components/watson_iot/__init__.py @@ -1,9 +1,4 @@ -""" -A component which allows you to send data to the IBM Watson IoT Platform. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/watson_iot/ -""" +"""Support for the IBM Watson IoT Platform.""" import logging import queue import threading @@ -44,7 +39,7 @@ CONFIG_SCHEMA = vol.Schema({ vol.Optional(CONF_INCLUDE, default={}): vol.Schema({ vol.Optional(CONF_ENTITIES, default=[]): cv.entity_ids, vol.Optional(CONF_DOMAINS, default=[]): - vol.All(cv.ensure_list, [cv.string]) + vol.All(cv.ensure_list, [cv.string]), }), })), }, extra=vol.ALLOW_EXTRA) diff --git a/homeassistant/components/webhook/__init__.py b/homeassistant/components/webhook/__init__.py index 9ec6d0298ea..59be3ab1890 100644 --- a/homeassistant/components/webhook/__init__.py +++ b/homeassistant/components/webhook/__init__.py @@ -1,8 +1,4 @@ -"""Webhooks for Home Assistant. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/webhook/ -""" +"""Webhooks for Home Assistant.""" import logging from aiohttp.web import Response @@ -14,13 +10,16 @@ from homeassistant.auth.util import generate_secret from homeassistant.components import websocket_api from homeassistant.components.http.view import HomeAssistantView -DOMAIN = 'webhook' -DEPENDENCIES = ['http'] _LOGGER = logging.getLogger(__name__) +DEPENDENCIES = ['http'] + +DOMAIN = 'webhook' URL_WEBHOOK_PATH = "/api/webhook/{webhook_id}" + WS_TYPE_LIST = 'webhook/list' + SCHEMA_WS_LIST = websocket_api.BASE_COMMAND_MESSAGE_SCHEMA.extend({ vol.Required('type'): WS_TYPE_LIST, }) diff --git a/homeassistant/components/weblink/__init__.py b/homeassistant/components/weblink/__init__.py index cd87bd838fa..608328c659b 100644 --- a/homeassistant/components/weblink/__init__.py +++ b/homeassistant/components/weblink/__init__.py @@ -1,9 +1,4 @@ -""" -Support for links to external web pages. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/weblink/ -""" +"""Support for links to external web pages.""" import logging import voluptuous as vol diff --git a/homeassistant/components/webostv/__init__.py b/homeassistant/components/webostv/__init__.py index de9de74054c..f0b3c2c5f7e 100644 --- a/homeassistant/components/webostv/__init__.py +++ b/homeassistant/components/webostv/__init__.py @@ -1 +1 @@ -"""WebOS TV integration.""" +"""Support for WebOS TV.""" diff --git a/homeassistant/components/webostv/media_player.py b/homeassistant/components/webostv/media_player.py index d34dbe80778..a6cbfbae99d 100644 --- a/homeassistant/components/webostv/media_player.py +++ b/homeassistant/components/webostv/media_player.py @@ -1,9 +1,4 @@ -""" -Support for interface with an LG webOS Smart TV. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/media_player.webostv/ -""" +"""Support for interface with an LG webOS Smart TV.""" import asyncio from datetime import timedelta import logging diff --git a/homeassistant/components/webostv/notify.py b/homeassistant/components/webostv/notify.py index 92762b03aea..5887586df65 100644 --- a/homeassistant/components/webostv/notify.py +++ b/homeassistant/components/webostv/notify.py @@ -1,9 +1,4 @@ -""" -LG WebOS TV notification service. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/notify.webostv/ -""" +"""Support for LG WebOS TV notification service.""" import logging import voluptuous as vol @@ -22,7 +17,7 @@ WEBOSTV_CONFIG_FILE = 'webostv.conf' PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ vol.Required(CONF_HOST): cv.string, vol.Optional(CONF_FILENAME, default=WEBOSTV_CONFIG_FILE): cv.string, - vol.Optional(CONF_ICON): cv.string + vol.Optional(CONF_ICON): cv.string, }) @@ -32,8 +27,8 @@ def get_service(hass, config, discovery_info=None): from pylgtv import PyLGTVPairException path = hass.config.path(config.get(CONF_FILENAME)) - client = WebOsClient(config.get(CONF_HOST), key_file_path=path, - timeout_connect=8) + client = WebOsClient( + config.get(CONF_HOST), key_file_path=path, timeout_connect=8) if not client.is_registered(): try: diff --git a/homeassistant/components/websocket_api/__init__.py b/homeassistant/components/websocket_api/__init__.py index 48c8f27996a..3734f46abb7 100644 --- a/homeassistant/components/websocket_api/__init__.py +++ b/homeassistant/components/websocket_api/__init__.py @@ -1,9 +1,4 @@ -""" -Websocket based API for Home Assistant. - -For more details about this component, please refer to the documentation at -https://developers.home-assistant.io/docs/external_api_websocket.html -""" +"""WebSocket based API for Home Assistant.""" from homeassistant.core import callback from homeassistant.loader import bind_hass diff --git a/homeassistant/components/websocket_api/commands.py b/homeassistant/components/websocket_api/commands.py index ff928b43873..34bb04cb394 100644 --- a/homeassistant/components/websocket_api/commands.py +++ b/homeassistant/components/websocket_api/commands.py @@ -9,7 +9,6 @@ from homeassistant.helpers.service import async_get_all_descriptions from . import const, decorators, messages - TYPE_CALL_SERVICE = 'call_service' TYPE_EVENT = 'event' TYPE_GET_CONFIG = 'get_config' diff --git a/homeassistant/components/wemo/__init__.py b/homeassistant/components/wemo/__init__.py index 3ec9b8920c3..709b3ec8672 100644 --- a/homeassistant/components/wemo/__init__.py +++ b/homeassistant/components/wemo/__init__.py @@ -1,9 +1,4 @@ -""" -Support for WeMo device discovery. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/wemo/ -""" +"""Support for WeMo device discovery.""" import logging import requests @@ -31,7 +26,7 @@ WEMO_MODEL_DISPATCH = { 'Maker': 'switch', 'Motion': 'binary_sensor', 'Sensor': 'binary_sensor', - 'Socket': 'switch' + 'Socket': 'switch', } SUBSCRIPTION_REGISTRY = None @@ -68,8 +63,7 @@ CONFIG_SCHEMA = vol.Schema({ vol.Optional(CONF_STATIC, default=[]): vol.Schema([ vol.All(cv.string, coerce_host_port) ]), - vol.Optional(CONF_DISCOVERY, - default=DEFAULT_DISCOVERY): cv.boolean + vol.Optional(CONF_DISCOVERY, default=DEFAULT_DISCOVERY): cv.boolean, }), }, extra=vol.ALLOW_EXTRA) @@ -115,17 +109,17 @@ def setup(hass, config): # Only register a device once if serial in KNOWN_DEVICES: - _LOGGER.debug('Ignoring known device %s %s', - service, discovery_info) + _LOGGER.debug( + "Ignoring known device %s %s", service, discovery_info) return - _LOGGER.debug('Discovered unique WeMo device: %s', serial) + _LOGGER.debug("Discovered unique WeMo device: %s", serial) KNOWN_DEVICES.append(serial) component = WEMO_MODEL_DISPATCH.get(model_name, 'switch') - discovery.load_platform(hass, component, DOMAIN, - discovery_info, config) + discovery.load_platform( + hass, component, DOMAIN, discovery_info, config) discovery.listen(hass, SERVICE_WEMO, discovery_dispatch) @@ -146,7 +140,7 @@ def setup(hass, config): device = pywemo.discovery.device_from_description(url, None) except (requests.exceptions.ConnectionError, requests.exceptions.Timeout) as err: - _LOGGER.error('Unable to access WeMo at %s (%s)', url, err) + _LOGGER.error("Unable to access WeMo at %s (%s)", url, err) continue if not [d[1] for d in devices @@ -162,8 +156,8 @@ def setup(hass, config): device)) for url, device in devices: - _LOGGER.debug('Adding WeMo device at %s:%i', - device.host, device.port) + _LOGGER.debug( + "Adding WeMo device at %s:%i", device.host, device.port) discovery_info = { 'model_name': device.model_name, @@ -176,7 +170,6 @@ def setup(hass, config): _LOGGER.debug("WeMo device discovery has finished") - hass.bus.listen_once(EVENT_HOMEASSISTANT_START, - discover_wemo_devices) + hass.bus.listen_once(EVENT_HOMEASSISTANT_START, discover_wemo_devices) return True diff --git a/homeassistant/components/wemo/binary_sensor.py b/homeassistant/components/wemo/binary_sensor.py index e44cbb31e66..d6c1ad721b9 100644 --- a/homeassistant/components/wemo/binary_sensor.py +++ b/homeassistant/components/wemo/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for WeMo sensors. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.wemo/ -""" +"""Support for WeMo binary sensors.""" import asyncio import logging diff --git a/homeassistant/components/wemo/fan.py b/homeassistant/components/wemo/fan.py index fbf72185ac2..29a493bf5bc 100644 --- a/homeassistant/components/wemo/fan.py +++ b/homeassistant/components/wemo/fan.py @@ -1,9 +1,4 @@ -""" -Support for WeMo humidifier. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/fan.wemo/ -""" +"""Support for WeMo humidifier.""" import asyncio import logging from datetime import timedelta diff --git a/homeassistant/components/wemo/light.py b/homeassistant/components/wemo/light.py index 38044b7a736..e0f729fb165 100644 --- a/homeassistant/components/wemo/light.py +++ b/homeassistant/components/wemo/light.py @@ -1,9 +1,4 @@ -""" -Support for Belkin WeMo lights. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/light.wemo/ -""" +"""Support for Belkin WeMo lights.""" import asyncio import logging from datetime import timedelta diff --git a/homeassistant/components/wemo/switch.py b/homeassistant/components/wemo/switch.py index 0815f307a9a..0a583e49e96 100644 --- a/homeassistant/components/wemo/switch.py +++ b/homeassistant/components/wemo/switch.py @@ -1,9 +1,4 @@ -""" -Support for WeMo switches. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/switch.wemo/ -""" +"""Support for WeMo switches.""" import asyncio import logging from datetime import datetime, timedelta @@ -47,7 +42,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): device = discovery.device_from_description(location, mac) except (requests.exceptions.ConnectionError, requests.exceptions.Timeout) as err: - _LOGGER.error('Unable to access %s (%s)', location, err) + _LOGGER.error("Unable to access %s (%s)", location, err) raise PlatformNotReady if device: diff --git a/homeassistant/components/wink/__init__.py b/homeassistant/components/wink/__init__.py index 3cedb0b126b..2b03d7711ac 100644 --- a/homeassistant/components/wink/__init__.py +++ b/homeassistant/components/wink/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Wink hubs. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/wink/ -""" +"""Support for Wink hubs.""" from datetime import timedelta import json import logging @@ -56,7 +51,7 @@ USER_AGENT = "Manufacturer/Home-Assistant{} python/3 Wink/3".format( DEFAULT_CONFIG = { 'client_id': 'CLIENT_ID_HERE', - 'client_secret': 'CLIENT_SECRET_HERE' + 'client_secret': 'CLIENT_SECRET_HERE', } SERVICE_ADD_NEW_DEVICES = 'pull_newly_added_devices_from_wink' @@ -115,42 +110,42 @@ CONFIG_SCHEMA = vol.Schema({ RENAME_DEVICE_SCHEMA = vol.Schema({ vol.Required(ATTR_ENTITY_ID): cv.entity_ids, - vol.Required(ATTR_NAME): cv.string + vol.Required(ATTR_NAME): cv.string, }, extra=vol.ALLOW_EXTRA) DELETE_DEVICE_SCHEMA = vol.Schema({ - vol.Required(ATTR_ENTITY_ID): cv.entity_ids + vol.Required(ATTR_ENTITY_ID): cv.entity_ids, }, extra=vol.ALLOW_EXTRA) SET_PAIRING_MODE_SCHEMA = vol.Schema({ vol.Required(ATTR_HUB_NAME): cv.string, vol.Required(ATTR_PAIRING_MODE): cv.string, - vol.Optional(ATTR_KIDDE_RADIO_CODE): cv.string + vol.Optional(ATTR_KIDDE_RADIO_CODE): cv.string, }, extra=vol.ALLOW_EXTRA) SET_VOLUME_SCHEMA = vol.Schema({ vol.Optional(ATTR_ENTITY_ID): cv.entity_ids, - vol.Required(ATTR_VOLUME): vol.In(VOLUMES) + vol.Required(ATTR_VOLUME): vol.In(VOLUMES), }) SET_SIREN_TONE_SCHEMA = vol.Schema({ vol.Optional(ATTR_ENTITY_ID): cv.entity_ids, - vol.Required(ATTR_TONE): vol.In(TONES) + vol.Required(ATTR_TONE): vol.In(TONES), }) SET_CHIME_MODE_SCHEMA = vol.Schema({ vol.Optional(ATTR_ENTITY_ID): cv.entity_ids, - vol.Required(ATTR_TONE): vol.In(CHIME_TONES) + vol.Required(ATTR_TONE): vol.In(CHIME_TONES), }) SET_AUTO_SHUTOFF_SCHEMA = vol.Schema({ vol.Optional(ATTR_ENTITY_ID): cv.entity_ids, - vol.Required(ATTR_AUTO_SHUTOFF): vol.In(AUTO_SHUTOFF_TIMES) + vol.Required(ATTR_AUTO_SHUTOFF): vol.In(AUTO_SHUTOFF_TIMES), }) SET_STROBE_ENABLED_SCHEMA = vol.Schema({ vol.Optional(ATTR_ENTITY_ID): cv.entity_ids, - vol.Required(ATTR_ENABLED): cv.boolean + vol.Required(ATTR_ENABLED): cv.boolean, }) ENABLED_SIREN_SCHEMA = vol.Schema({ @@ -166,13 +161,13 @@ DIAL_CONFIG_SCHEMA = vol.Schema({ vol.Optional(ATTR_MAX_POSITION): cv.positive_int, vol.Optional(ATTR_ROTATION): vol.In(ROTATIONS), vol.Optional(ATTR_SCALE): vol.In(SCALES), - vol.Optional(ATTR_TICKS): cv.positive_int + vol.Optional(ATTR_TICKS): cv.positive_int, }) DIAL_STATE_SCHEMA = vol.Schema({ vol.Required(ATTR_ENTITY_ID): cv.entity_ids, vol.Required(ATTR_VALUE): vol.Coerce(int), - vol.Optional(ATTR_LABELS): cv.ensure_list(cv.string) + vol.Optional(ATTR_LABELS): cv.ensure_list(cv.string), }) WINK_COMPONENTS = [ diff --git a/homeassistant/components/wink/alarm_control_panel.py b/homeassistant/components/wink/alarm_control_panel.py index b2ae3578133..594198ddd12 100644 --- a/homeassistant/components/wink/alarm_control_panel.py +++ b/homeassistant/components/wink/alarm_control_panel.py @@ -1,9 +1,4 @@ -""" -Interfaces with Wink Cameras. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/alarm_control_panel.wink/ -""" +"""Support Wink alarm control panels.""" import logging import homeassistant.components.alarm_control_panel as alarm diff --git a/homeassistant/components/wink/binary_sensor.py b/homeassistant/components/wink/binary_sensor.py index a950289789e..12e1b557a73 100644 --- a/homeassistant/components/wink/binary_sensor.py +++ b/homeassistant/components/wink/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for Wink binary sensors. - -For more details about this platform, please refer to the documentation at -at https://home-assistant.io/components/binary_sensor.wink/ -""" +"""Support for Wink binary sensors.""" import logging from homeassistant.components.binary_sensor import BinarySensorDevice diff --git a/homeassistant/components/wink/climate.py b/homeassistant/components/wink/climate.py index 7e5230ba3c7..8d946bf03df 100644 --- a/homeassistant/components/wink/climate.py +++ b/homeassistant/components/wink/climate.py @@ -1,9 +1,4 @@ -""" -Support for Wink thermostats and Air Conditioners. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/climate.wink/ -""" +"""Support for Wink thermostats and Air Conditioners.""" import logging from homeassistant.components.climate import ( diff --git a/homeassistant/components/wink/cover.py b/homeassistant/components/wink/cover.py index 3cf9c753e3a..19ff792592f 100644 --- a/homeassistant/components/wink/cover.py +++ b/homeassistant/components/wink/cover.py @@ -1,9 +1,4 @@ -""" -Support for Wink Covers. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/cover.wink/ -""" +"""Support for Wink covers.""" from homeassistant.components.cover import CoverDevice, ATTR_POSITION from homeassistant.components.wink import WinkDevice, DOMAIN diff --git a/homeassistant/components/wink/fan.py b/homeassistant/components/wink/fan.py index eca985a8d1e..5bc6e03c49b 100644 --- a/homeassistant/components/wink/fan.py +++ b/homeassistant/components/wink/fan.py @@ -1,9 +1,4 @@ -""" -Support for Wink fans. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/fan.wink/ -""" +"""Support for Wink fans.""" import logging from homeassistant.components.fan import ( diff --git a/homeassistant/components/wink/light.py b/homeassistant/components/wink/light.py index 96c8f20679e..14a983154f8 100644 --- a/homeassistant/components/wink/light.py +++ b/homeassistant/components/wink/light.py @@ -1,10 +1,4 @@ -""" -Support for Wink lights. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/light.wink/ -""" - +"""Support for Wink lights.""" from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_HS_COLOR, SUPPORT_BRIGHTNESS, SUPPORT_COLOR_TEMP, SUPPORT_COLOR, Light) diff --git a/homeassistant/components/wink/lock.py b/homeassistant/components/wink/lock.py index 68cc7a79ae6..0ef4f30dc5a 100644 --- a/homeassistant/components/wink/lock.py +++ b/homeassistant/components/wink/lock.py @@ -1,9 +1,4 @@ -""" -Support for Wink locks. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/lock.wink/ -""" +"""Support for Wink locks.""" import logging import voluptuous as vol diff --git a/homeassistant/components/wink/scene.py b/homeassistant/components/wink/scene.py index 35db96c3b8b..d05fe58a427 100644 --- a/homeassistant/components/wink/scene.py +++ b/homeassistant/components/wink/scene.py @@ -1,9 +1,4 @@ -""" -Support for Wink scenes. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/scene.wink/ -""" +"""Support for Wink scenes.""" import logging from homeassistant.components.scene import Scene diff --git a/homeassistant/components/wink/sensor.py b/homeassistant/components/wink/sensor.py index 3e228c4b40b..ab61769c94d 100644 --- a/homeassistant/components/wink/sensor.py +++ b/homeassistant/components/wink/sensor.py @@ -1,9 +1,4 @@ -""" -Support for Wink sensors. - -For more details about this platform, please refer to the documentation at -at https://home-assistant.io/components/sensor.wink/ -""" +"""Support for Wink sensors.""" import logging from homeassistant.components.wink import DOMAIN, WinkDevice diff --git a/homeassistant/components/wink/switch.py b/homeassistant/components/wink/switch.py index 9dea93488af..cd55026879a 100644 --- a/homeassistant/components/wink/switch.py +++ b/homeassistant/components/wink/switch.py @@ -1,9 +1,4 @@ -""" -Support for Wink switches. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.wink/ -""" +"""Support for Wink switches.""" import logging from homeassistant.components.wink import DOMAIN, WinkDevice diff --git a/homeassistant/components/wink/water_heater.py b/homeassistant/components/wink/water_heater.py index a840baf980a..34cd86a50f4 100644 --- a/homeassistant/components/wink/water_heater.py +++ b/homeassistant/components/wink/water_heater.py @@ -1,9 +1,4 @@ -""" -Support for Wink water heaters. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/water_heater.wink/ -""" +"""Support for Wink water heaters.""" import logging from homeassistant.components.water_heater import ( diff --git a/homeassistant/components/wirelesstag/__init__.py b/homeassistant/components/wirelesstag/__init__.py index 77b4c48b41b..28c8cb4d515 100644 --- a/homeassistant/components/wirelesstag/__init__.py +++ b/homeassistant/components/wirelesstag/__init__.py @@ -1,10 +1,4 @@ -""" -Wireless Sensor Tags platform support. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/wirelesstag/ -""" - +"""Support for Wireless Sensor Tags.""" import logging from requests.exceptions import HTTPError, ConnectTimeout @@ -22,11 +16,11 @@ REQUIREMENTS = ['wirelesstagpy==0.4.0'] _LOGGER = logging.getLogger(__name__) -# strength of signal in dBm +# Strength of signal in dBm ATTR_TAG_SIGNAL_STRENGTH = 'signal_strength' -# indicates if tag is out of range or not +# Indicates if tag is out of range or not ATTR_TAG_OUT_OF_RANGE = 'out_of_range' -# number in percents from max power of tag receiver +# Number in percents from max power of tag receiver ATTR_TAG_POWER_CONSUMPTION = 'power_consumption' @@ -36,11 +30,11 @@ NOTIFICATION_TITLE = "Wireless Sensor Tag Setup" DOMAIN = 'wirelesstag' DEFAULT_ENTITY_NAMESPACE = 'wirelesstag' -# template for signal - first parameter is tag_id, +# Template for signal - first parameter is tag_id, # second, tag manager mac address SIGNAL_TAG_UPDATE = 'wirelesstag.tag_info_updated_{}_{}' -# template for signal - tag_id, sensor type and +# Template for signal - tag_id, sensor type and # tag manager mac address SIGNAL_BINARY_EVENT_UPDATE = 'wirelesstag.binary_event_updated_{}_{}_{}' diff --git a/homeassistant/components/wirelesstag/binary_sensor.py b/homeassistant/components/wirelesstag/binary_sensor.py index 190b408abf3..6f2c24a7788 100644 --- a/homeassistant/components/wirelesstag/binary_sensor.py +++ b/homeassistant/components/wirelesstag/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Binary sensor support for Wireless Sensor Tags. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.wirelesstag/ -""" +"""Binary sensor support for Wireless Sensor Tags.""" import logging import voluptuous as vol diff --git a/homeassistant/components/wirelesstag/sensor.py b/homeassistant/components/wirelesstag/sensor.py index eb9ce297065..3703e214d83 100644 --- a/homeassistant/components/wirelesstag/sensor.py +++ b/homeassistant/components/wirelesstag/sensor.py @@ -1,10 +1,4 @@ -""" -Sensor support for Wireless Sensor Tags platform. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.wirelesstag/ -""" - +"""Sensor support for Wireless Sensor Tags platform.""" import logging import voluptuous as vol @@ -32,7 +26,7 @@ SENSOR_TYPES = [ SENSOR_TEMPERATURE, SENSOR_HUMIDITY, SENSOR_MOISTURE, - SENSOR_LIGHT + SENSOR_LIGHT, ] PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ @@ -69,9 +63,9 @@ class WirelessTagSensor(WirelessTagBaseSensor): # sensor.wirelesstag_bedroom_temperature # and not as sensor.bedroom for temperature and # sensor.bedroom_2 for humidity - self._entity_id = '{}.{}_{}_{}'.format('sensor', WIRELESSTAG_DOMAIN, - self.underscored_name, - self._sensor_type) + self._entity_id = '{}.{}_{}_{}'.format( + 'sensor', WIRELESSTAG_DOMAIN, self.underscored_name, + self._sensor_type) async def async_added_to_hass(self): """Register callbacks.""" @@ -118,8 +112,8 @@ class WirelessTagSensor(WirelessTagBaseSensor): @callback def _update_tag_info_callback(self, event): """Handle push notification sent by tag manager.""" - _LOGGER.info("Entity to update state: %s event data: %s", - self, event.data) + _LOGGER.debug( + "Entity to update state: %s event data: %s", self, event.data) new_value = self._sensor.value_from_update_event(event.data) self._state = self.decorate_value(new_value) self.async_schedule_update_ha_state() diff --git a/homeassistant/components/wirelesstag/switch.py b/homeassistant/components/wirelesstag/switch.py index cbe62d107da..913438e9d8c 100644 --- a/homeassistant/components/wirelesstag/switch.py +++ b/homeassistant/components/wirelesstag/switch.py @@ -1,9 +1,4 @@ -""" -Switch implementation for Wireless Sensor Tags (wirelesstag.net) platform. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.wirelesstag/ -""" +"""Switch implementation for Wireless Sensor Tags (wirelesstag.net).""" import logging import voluptuous as vol @@ -64,8 +59,8 @@ class WirelessTagSwitch(WirelessTagBaseSensor, SwitchDevice): super().__init__(api, tag) self._switch_type = switch_type self.sensor_type = SWITCH_TYPES[self._switch_type][1] - self._name = '{} {}'.format(self._tag.name, - SWITCH_TYPES[self._switch_type][0]) + self._name = '{} {}'.format( + self._tag.name, SWITCH_TYPES[self._switch_type][0]) def turn_on(self, **kwargs): """Turn on the switch.""" diff --git a/homeassistant/components/wunderlist/__init__.py b/homeassistant/components/wunderlist/__init__.py index f64d97dfc0d..d67cf089b5e 100644 --- a/homeassistant/components/wunderlist/__init__.py +++ b/homeassistant/components/wunderlist/__init__.py @@ -1,9 +1,4 @@ -""" -Component to interact with Wunderlist. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/wunderlist/ -""" +"""Support to interact with Wunderlist.""" import logging import voluptuous as vol @@ -25,7 +20,7 @@ CONF_STARRED = 'starred' CONFIG_SCHEMA = vol.Schema({ DOMAIN: vol.Schema({ vol.Required(CONF_CLIENT_ID): cv.string, - vol.Required(CONF_ACCESS_TOKEN): cv.string + vol.Required(CONF_ACCESS_TOKEN): cv.string, }) }, extra=vol.ALLOW_EXTRA) @@ -35,7 +30,7 @@ SERVICE_CREATE_TASK = 'create_task' SERVICE_SCHEMA_CREATE_TASK = vol.Schema({ vol.Required(CONF_LIST_NAME): cv.string, vol.Required(CONF_NAME): cv.string, - vol.Optional(CONF_STARRED): cv.boolean + vol.Optional(CONF_STARRED): cv.boolean, }) diff --git a/homeassistant/components/xiaomi_aqara/__init__.py b/homeassistant/components/xiaomi_aqara/__init__.py index ca2d8c1a169..ce943fb2c93 100644 --- a/homeassistant/components/xiaomi_aqara/__init__.py +++ b/homeassistant/components/xiaomi_aqara/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Xiaomi Gateways. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/xiaomi_aqara/ -""" +"""Support for Xiaomi Gateways.""" import logging from datetime import timedelta diff --git a/homeassistant/components/xiaomi_aqara/lock.py b/homeassistant/components/xiaomi_aqara/lock.py index 15415a73284..f19492664b1 100644 --- a/homeassistant/components/xiaomi_aqara/lock.py +++ b/homeassistant/components/xiaomi_aqara/lock.py @@ -1,9 +1,4 @@ -""" -Support for Xiaomi Aqara Lock. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/lock.xiaomi_aqara/ -""" +"""Support for Xiaomi Aqara locks.""" import logging from homeassistant.components.xiaomi_aqara import (PY_XIAOMI_GATEWAY, XiaomiDevice) @@ -24,8 +19,8 @@ ATTR_VERIFIED_WRONG_TIMES = 'verified_wrong_times' UNLOCK_MAINTAIN_TIME = 5 -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Perform the setup for Xiaomi devices.""" devices = [] diff --git a/homeassistant/components/xiaomi_aqara/sensor.py b/homeassistant/components/xiaomi_aqara/sensor.py index 1859b7be16a..133814e216e 100644 --- a/homeassistant/components/xiaomi_aqara/sensor.py +++ b/homeassistant/components/xiaomi_aqara/sensor.py @@ -1,4 +1,4 @@ -"""Support for Xiaomi aqara sensors.""" +"""Support for Xiaomi Aqara sensors.""" import logging from homeassistant.components.xiaomi_aqara import (PY_XIAOMI_GATEWAY, diff --git a/homeassistant/components/xiaomi_aqara/switch.py b/homeassistant/components/xiaomi_aqara/switch.py index 166f51fb091..c3cde8ede6d 100644 --- a/homeassistant/components/xiaomi_aqara/switch.py +++ b/homeassistant/components/xiaomi_aqara/switch.py @@ -1,4 +1,4 @@ -"""Support for Xiaomi aqara binary sensors.""" +"""Support for Xiaomi Aqara binary sensors.""" import logging from homeassistant.components.switch import SwitchDevice @@ -31,39 +31,33 @@ def setup_platform(hass, config, add_entities, discovery_info=None): data_key = 'status' else: data_key = 'channel_0' - devices.append(XiaomiGenericSwitch(device, "Plug", data_key, - True, gateway)) + devices.append(XiaomiGenericSwitch( + device, "Plug", data_key, True, gateway)) elif model in ['ctrl_neutral1', 'ctrl_neutral1.aq1']: - devices.append(XiaomiGenericSwitch(device, 'Wall Switch', - 'channel_0', - False, gateway)) + devices.append(XiaomiGenericSwitch( + device, 'Wall Switch', 'channel_0', False, gateway)) elif model in ['ctrl_ln1', 'ctrl_ln1.aq1']: - devices.append(XiaomiGenericSwitch(device, 'Wall Switch LN', - 'channel_0', - False, gateway)) + devices.append(XiaomiGenericSwitch( + device, 'Wall Switch LN', 'channel_0', False, gateway)) elif model in ['ctrl_neutral2', 'ctrl_neutral2.aq1']: - devices.append(XiaomiGenericSwitch(device, 'Wall Switch Left', - 'channel_0', - False, gateway)) - devices.append(XiaomiGenericSwitch(device, 'Wall Switch Right', - 'channel_1', - False, gateway)) + devices.append(XiaomiGenericSwitch( + device, 'Wall Switch Left', 'channel_0', False, gateway)) + devices.append(XiaomiGenericSwitch( + device, 'Wall Switch Right', 'channel_1', False, gateway)) elif model in ['ctrl_ln2', 'ctrl_ln2.aq1']: - devices.append(XiaomiGenericSwitch(device, - 'Wall Switch LN Left', - 'channel_0', - False, gateway)) - devices.append(XiaomiGenericSwitch(device, - 'Wall Switch LN Right', - 'channel_1', - False, gateway)) + devices.append(XiaomiGenericSwitch( + device, 'Wall Switch LN Left', 'channel_0', False, + gateway)) + devices.append(XiaomiGenericSwitch( + device, 'Wall Switch LN Right', 'channel_1', + False, gateway)) elif model in ['86plug', 'ctrl_86plug', 'ctrl_86plug.aq1']: if 'proto' not in device or int(device['proto'][0:1]) == 1: data_key = 'status' else: data_key = 'channel_0' - devices.append(XiaomiGenericSwitch(device, 'Wall Plug', - data_key, True, gateway)) + devices.append(XiaomiGenericSwitch( + device, 'Wall Plug', data_key, True, gateway)) add_entities(devices) @@ -96,9 +90,11 @@ class XiaomiGenericSwitch(XiaomiDevice, SwitchDevice): def device_state_attributes(self): """Return the state attributes.""" if self._supports_power_consumption: - attrs = {ATTR_IN_USE: self._in_use, - ATTR_LOAD_POWER: self._load_power, - ATTR_POWER_CONSUMED: self._power_consumed} + attrs = { + ATTR_IN_USE: self._in_use, + ATTR_LOAD_POWER: self._load_power, + ATTR_POWER_CONSUMED: self._power_consumed, + } else: attrs = {} attrs.update(super().device_state_attributes) diff --git a/homeassistant/components/xiaomi_miio/__init__.py b/homeassistant/components/xiaomi_miio/__init__.py index 2f9bee9d702..9abc871b9b4 100644 --- a/homeassistant/components/xiaomi_miio/__init__.py +++ b/homeassistant/components/xiaomi_miio/__init__.py @@ -1 +1 @@ -"""Xiaomi Miio integration.""" +"""Support for Xiaomi Miio.""" diff --git a/homeassistant/components/xiaomi_miio/device_tracker.py b/homeassistant/components/xiaomi_miio/device_tracker.py index c5c6ebcbc35..1aec3647d61 100644 --- a/homeassistant/components/xiaomi_miio/device_tracker.py +++ b/homeassistant/components/xiaomi_miio/device_tracker.py @@ -1,9 +1,4 @@ -""" -Support for Xiaomi Mi WiFi Repeater 2. - -For more details about this platform, please refer to the documentation -https://home-assistant.io/components/device_tracker.xiaomi_miio/ -""" +"""Support for Xiaomi Mi WiFi Repeater 2.""" import logging import voluptuous as vol diff --git a/homeassistant/components/xiaomi_miio/fan.py b/homeassistant/components/xiaomi_miio/fan.py index 2e0b1657d23..c4cfa6bbe6b 100644 --- a/homeassistant/components/xiaomi_miio/fan.py +++ b/homeassistant/components/xiaomi_miio/fan.py @@ -1,9 +1,4 @@ -""" -Support for Xiaomi Mi Air Purifier and Xiaomi Mi Air Humidifier. - -For more details about this platform, please refer to the documentation -https://home-assistant.io/components/fan.xiaomi_miio/ -""" +"""Support for Xiaomi Mi Air Purifier and Xiaomi Mi Air Humidifier.""" import asyncio from enum import Enum from functools import partial diff --git a/homeassistant/components/xiaomi_miio/light.py b/homeassistant/components/xiaomi_miio/light.py index 62433ca9f97..3ae6bfe6cd7 100644 --- a/homeassistant/components/xiaomi_miio/light.py +++ b/homeassistant/components/xiaomi_miio/light.py @@ -1,11 +1,4 @@ -""" -Support for Xiaomi Philips Lights. - -LED Ball, Candle, Downlight, Ceiling, Eyecare 2, Bedside & Desklamp Lamp. - -For more details about this platform, please refer to the documentation -https://home-assistant.io/components/light.xiaomi_miio/ -""" +"""Support for Xiaomi Philips Lights.""" import asyncio import datetime from datetime import timedelta diff --git a/homeassistant/components/xiaomi_miio/remote.py b/homeassistant/components/xiaomi_miio/remote.py index c8ffd043321..1c4ae85a0d8 100644 --- a/homeassistant/components/xiaomi_miio/remote.py +++ b/homeassistant/components/xiaomi_miio/remote.py @@ -1,9 +1,4 @@ -""" -Support for the Xiaomi IR Remote (Chuangmi IR). - -For more details about this platform, please refer to the documentation -https://home-assistant.io/components/remote.xiaomi_miio/ -""" +"""Support for the Xiaomi IR Remote (Chuangmi IR).""" import asyncio import logging import time @@ -37,8 +32,7 @@ DEFAULT_SLOT = 1 LEARN_COMMAND_SCHEMA = vol.Schema({ vol.Required(ATTR_ENTITY_ID): vol.All(str), - vol.Optional(CONF_TIMEOUT, default=10): - vol.All(int, vol.Range(min=0)), + vol.Optional(CONF_TIMEOUT, default=10): vol.All(int, vol.Range(min=0)), vol.Optional(CONF_SLOT, default=1): vol.All(int, vol.Range(min=1, max=1000000)), }) diff --git a/homeassistant/components/xiaomi_miio/sensor.py b/homeassistant/components/xiaomi_miio/sensor.py index ef5ed1d5c38..bd5f8642e54 100644 --- a/homeassistant/components/xiaomi_miio/sensor.py +++ b/homeassistant/components/xiaomi_miio/sensor.py @@ -1,9 +1,4 @@ -""" -Support for Xiaomi Mi Air Quality Monitor (PM2.5). - -For more details about this platform, please refer to the documentation -https://home-assistant.io/components/sensor.xiaomi_miio/ -""" +"""Support for Xiaomi Mi Air Quality Monitor (PM2.5).""" import logging import voluptuous as vol diff --git a/homeassistant/components/xiaomi_miio/switch.py b/homeassistant/components/xiaomi_miio/switch.py index 4ead90ca4ec..eb7f09f95e6 100644 --- a/homeassistant/components/xiaomi_miio/switch.py +++ b/homeassistant/components/xiaomi_miio/switch.py @@ -1,9 +1,4 @@ -""" -Support for Xiaomi Smart WiFi Socket and Smart Power Strip. - -For more details about this platform, please refer to the documentation -https://home-assistant.io/components/switch.xiaomi_miio/ -""" +"""Support for Xiaomi Smart WiFi Socket and Smart Power Strip.""" import asyncio from functools import partial import logging diff --git a/homeassistant/components/xiaomi_miio/vacuum.py b/homeassistant/components/xiaomi_miio/vacuum.py index a6613f7c3c3..82a92dd317c 100644 --- a/homeassistant/components/xiaomi_miio/vacuum.py +++ b/homeassistant/components/xiaomi_miio/vacuum.py @@ -1,9 +1,4 @@ -""" -Support for the Xiaomi vacuum cleaner robot. - -For more details about this platform, please refer to the documentation -https://home-assistant.io/components/vacuum.xiaomi_miio/ -""" +"""Support for the Xiaomi vacuum cleaner robot.""" import asyncio from functools import partial import logging diff --git a/homeassistant/components/xs1/__init__.py b/homeassistant/components/xs1/__init__.py index 14656737f5c..f67eb8fd15a 100644 --- a/homeassistant/components/xs1/__init__.py +++ b/homeassistant/components/xs1/__init__.py @@ -1,10 +1,4 @@ -""" -Support for the EZcontrol XS1 gateway. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/xs1/ -""" - +"""Support for the EZcontrol XS1 gateway.""" import asyncio from functools import partial import logging @@ -29,17 +23,17 @@ SENSORS = 'sensors' CONFIG_SCHEMA = vol.Schema({ DOMAIN: vol.Schema({ vol.Required(CONF_HOST): cv.string, + vol.Optional(CONF_PASSWORD): cv.string, vol.Optional(CONF_PORT, default=80): cv.string, vol.Optional(CONF_SSL, default=False): cv.boolean, vol.Optional(CONF_USERNAME): cv.string, - vol.Optional(CONF_PASSWORD): cv.string }), }, extra=vol.ALLOW_EXTRA) XS1_COMPONENTS = [ - 'switch', + 'climate', 'sensor', - 'climate' + 'switch', ] # Lock used to limit the amount of concurrent update requests @@ -54,13 +48,9 @@ def _create_controller_api(host, port, ssl, user, password): try: return xs1_api_client.XS1( - host=host, - port=port, - ssl=ssl, - user=user, - password=password) + host=host, port=port, ssl=ssl, user=user, password=password) except ConnectionError as error: - _LOGGER.error("Failed to create XS1 api client " + _LOGGER.error("Failed to create XS1 API client " "because of a connection error: %s", error) return None @@ -77,8 +67,7 @@ async def async_setup(hass, config): # initialize XS1 API xs1 = await hass.async_add_executor_job( - partial(_create_controller_api, - host, port, ssl, user, password)) + partial(_create_controller_api, host, port, ssl, user, password)) if xs1 is None: return False @@ -96,7 +85,7 @@ async def async_setup(hass, config): hass.data[DOMAIN][SENSORS] = sensors _LOGGER.debug("Loading components for XS1 platform...") - # load components for supported devices + # Load components for supported devices for component in XS1_COMPONENTS: hass.async_create_task( discovery.async_load_platform( diff --git a/homeassistant/components/xs1/climate.py b/homeassistant/components/xs1/climate.py index 0417d3bcde0..92a2c75895c 100644 --- a/homeassistant/components/xs1/climate.py +++ b/homeassistant/components/xs1/climate.py @@ -1,9 +1,4 @@ -""" -Support for XS1 climate devices. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/climate.xs1/ -""" +"""Support for XS1 climate devices.""" from functools import partial import logging @@ -19,8 +14,8 @@ MIN_TEMP = 8 MAX_TEMP = 25 -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up the XS1 thermostat platform.""" from xs1_api_client.api_constants import ActuatorType @@ -37,7 +32,6 @@ async def async_setup_platform(hass, config, async_add_entities, for sensor in sensors: if actuator_name in sensor.name(): matching_sensor = sensor - break thermostat_entities.append( diff --git a/homeassistant/components/xs1/sensor.py b/homeassistant/components/xs1/sensor.py index b4d9bfe5ff9..9de91a6b012 100644 --- a/homeassistant/components/xs1/sensor.py +++ b/homeassistant/components/xs1/sensor.py @@ -1,10 +1,4 @@ -""" -Support for XS1 sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.xs1/ -""" - +"""Support for XS1 sensors.""" import logging from homeassistant.components.xs1 import ( @@ -15,8 +9,8 @@ DEPENDENCIES = ['xs1'] _LOGGER = logging.getLogger(__name__) -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up the XS1 sensor platform.""" from xs1_api_client.api_constants import ActuatorType diff --git a/homeassistant/components/xs1/switch.py b/homeassistant/components/xs1/switch.py index e6855865845..35568587b19 100644 --- a/homeassistant/components/xs1/switch.py +++ b/homeassistant/components/xs1/switch.py @@ -1,21 +1,17 @@ -""" -Support for XS1 switches. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.xs1/ -""" +"""Support for XS1 switches.""" import logging from homeassistant.components.xs1 import ( ACTUATORS, DOMAIN as COMPONENT_DOMAIN, XS1DeviceEntity) from homeassistant.helpers.entity import ToggleEntity -DEPENDENCIES = ['xs1'] _LOGGER = logging.getLogger(__name__) +DEPENDENCIES = ['xs1'] -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): + +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Set up the XS1 switch platform.""" from xs1_api_client.api_constants import ActuatorType diff --git a/homeassistant/components/zabbix/__init__.py b/homeassistant/components/zabbix/__init__.py index ea5a6d85d6b..f33c60b1c39 100644 --- a/homeassistant/components/zabbix/__init__.py +++ b/homeassistant/components/zabbix/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Zabbix. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/zabbix/ -""" +"""Support for Zabbix.""" import logging from urllib.parse import urljoin @@ -19,17 +14,15 @@ _LOGGER = logging.getLogger(__name__) DEFAULT_SSL = False DEFAULT_PATH = 'zabbix' - DOMAIN = 'zabbix' - CONFIG_SCHEMA = vol.Schema({ DOMAIN: vol.Schema({ vol.Required(CONF_HOST): cv.string, - vol.Optional(CONF_SSL, default=DEFAULT_SSL): cv.boolean, + vol.Optional(CONF_PASSWORD): cv.string, vol.Optional(CONF_PATH, default=DEFAULT_PATH): cv.string, + vol.Optional(CONF_SSL, default=DEFAULT_SSL): cv.boolean, vol.Optional(CONF_USERNAME): cv.string, - vol.Optional(CONF_PASSWORD): cv.string }) }, extra=vol.ALLOW_EXTRA) diff --git a/homeassistant/components/zabbix/sensor.py b/homeassistant/components/zabbix/sensor.py index 7a468a9b906..ae2e70ede2c 100644 --- a/homeassistant/components/zabbix/sensor.py +++ b/homeassistant/components/zabbix/sensor.py @@ -1,9 +1,4 @@ -""" -Support for Zabbix Sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.zabbix/ -""" +"""Support for Zabbix sensors.""" import logging import voluptuous as vol diff --git a/homeassistant/components/zeroconf/__init__.py b/homeassistant/components/zeroconf/__init__.py index 5d6161da904..bf743eaf370 100644 --- a/homeassistant/components/zeroconf/__init__.py +++ b/homeassistant/components/zeroconf/__init__.py @@ -1,9 +1,4 @@ -""" -This module exposes Home Assistant via Zeroconf. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/zeroconf/ -""" +"""Support for exposing Home Assistant via Zeroconf.""" import logging import socket diff --git a/homeassistant/components/zigbee/__init__.py b/homeassistant/components/zigbee/__init__.py index 8829a3bb928..0e2d3587829 100644 --- a/homeassistant/components/zigbee/__init__.py +++ b/homeassistant/components/zigbee/__init__.py @@ -1,16 +1,11 @@ -""" -Support for Zigbee devices. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/zigbee/ -""" +"""Support for Zigbee devices.""" import logging from binascii import hexlify, unhexlify import voluptuous as vol from homeassistant.const import ( - EVENT_HOMEASSISTANT_STOP, CONF_DEVICE, CONF_NAME, CONF_PIN) + EVENT_HOMEASSISTANT_STOP, CONF_DEVICE, CONF_NAME, CONF_PIN, CONF_ADDRESS) from homeassistant.helpers.entity import Entity from homeassistant.helpers import config_validation as cv from homeassistant.helpers.dispatcher import ( @@ -24,7 +19,6 @@ DOMAIN = 'zigbee' SIGNAL_ZIGBEE_FRAME_RECEIVED = 'zigbee_frame_received' -CONF_ADDRESS = 'address' CONF_BAUD = 'baud' DEFAULT_DEVICE = '/dev/ttyUSB0' diff --git a/homeassistant/components/zigbee/binary_sensor.py b/homeassistant/components/zigbee/binary_sensor.py index 67c05f47094..eec1832f07d 100644 --- a/homeassistant/components/zigbee/binary_sensor.py +++ b/homeassistant/components/zigbee/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Contains functionality to use a Zigbee device as a binary sensor. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.zigbee/ -""" +"""Support for Zigbee binary sensors.""" import voluptuous as vol from homeassistant.components.binary_sensor import BinarySensorDevice diff --git a/homeassistant/components/zigbee/light.py b/homeassistant/components/zigbee/light.py index 42dc95d1163..e5016900be7 100644 --- a/homeassistant/components/zigbee/light.py +++ b/homeassistant/components/zigbee/light.py @@ -1,9 +1,4 @@ -""" -Functionality to use a ZigBee device as a light. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/light.zigbee/ -""" +"""Support for Zigbee lights.""" import voluptuous as vol from homeassistant.components.light import Light diff --git a/homeassistant/components/zigbee/sensor.py b/homeassistant/components/zigbee/sensor.py index a0a1b8bb7fd..48503e396a4 100644 --- a/homeassistant/components/zigbee/sensor.py +++ b/homeassistant/components/zigbee/sensor.py @@ -1,9 +1,4 @@ -""" -Support for functionality to use a ZigBee device as a sensor. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.zigbee/ -""" +"""Support for Zigbee sensors.""" import logging from binascii import hexlify diff --git a/homeassistant/components/zigbee/switch.py b/homeassistant/components/zigbee/switch.py index 81fb8348c4e..ef36e17d74b 100644 --- a/homeassistant/components/zigbee/switch.py +++ b/homeassistant/components/zigbee/switch.py @@ -1,9 +1,4 @@ -""" -Contains functionality to use a Zigbee device as a switch. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.zigbee/ -""" +"""Support for Zigbee switches.""" import voluptuous as vol from homeassistant.components.switch import SwitchDevice diff --git a/homeassistant/components/zone/__init__.py b/homeassistant/components/zone/__init__.py index 370b52d1360..242f0362088 100644 --- a/homeassistant/components/zone/__init__.py +++ b/homeassistant/components/zone/__init__.py @@ -1,10 +1,4 @@ -""" -Support for the definition of zones. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/zone/ -""" - +"""Support for the definition of zones.""" import logging import voluptuous as vol diff --git a/homeassistant/components/zone/zone.py b/homeassistant/components/zone/zone.py index ee8b53d6ee4..21084e18f06 100644 --- a/homeassistant/components/zone/zone.py +++ b/homeassistant/components/zone/zone.py @@ -1,5 +1,4 @@ -"""Component entity and functionality.""" - +"""Zone entity and functionality.""" from homeassistant.const import ATTR_HIDDEN, ATTR_LATITUDE, ATTR_LONGITUDE from homeassistant.helpers.entity import Entity from homeassistant.loader import bind_hass diff --git a/homeassistant/components/zoneminder/__init__.py b/homeassistant/components/zoneminder/__init__.py index 2cefa2e1049..a4d90d523aa 100644 --- a/homeassistant/components/zoneminder/__init__.py +++ b/homeassistant/components/zoneminder/__init__.py @@ -1,9 +1,4 @@ -""" -Support for ZoneMinder. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/zoneminder/ -""" +"""Support for ZoneMinder.""" import logging import voluptuous as vol diff --git a/homeassistant/components/zoneminder/binary_sensor.py b/homeassistant/components/zoneminder/binary_sensor.py index e206ffa80f1..f20f09e70a6 100644 --- a/homeassistant/components/zoneminder/binary_sensor.py +++ b/homeassistant/components/zoneminder/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Support for ZoneMinder Binary Sensor. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/binary_sensor.zoneminder/ -""" +"""Support for ZoneMinder binary sensors.""" from homeassistant.components.binary_sensor import BinarySensorDevice from homeassistant.components.zoneminder import DOMAIN as ZONEMINDER_DOMAIN @@ -11,8 +6,8 @@ from homeassistant.components.zoneminder import DOMAIN as ZONEMINDER_DOMAIN DEPENDENCIES = ['zoneminder'] -async def async_setup_platform(hass, config, add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, add_entities, discovery_info=None): """Set up the ZoneMinder binary sensor platform.""" sensors = [] for host_name, zm_client in hass.data[ZONEMINDER_DOMAIN].items(): diff --git a/homeassistant/components/zoneminder/camera.py b/homeassistant/components/zoneminder/camera.py index 8556fbf1e35..7f74712335c 100644 --- a/homeassistant/components/zoneminder/camera.py +++ b/homeassistant/components/zoneminder/camera.py @@ -1,9 +1,4 @@ -""" -Support for ZoneMinder camera streaming. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/camera.zoneminder/ -""" +"""Support for ZoneMinder camera streaming.""" import logging from homeassistant.const import CONF_NAME, CONF_VERIFY_SSL diff --git a/homeassistant/components/zoneminder/sensor.py b/homeassistant/components/zoneminder/sensor.py index abecc99e278..9eb6beb491c 100644 --- a/homeassistant/components/zoneminder/sensor.py +++ b/homeassistant/components/zoneminder/sensor.py @@ -1,9 +1,4 @@ -""" -Support for ZoneMinder Sensors. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/sensor.zoneminder/ -""" +"""Support for ZoneMinder sensors.""" import logging import voluptuous as vol diff --git a/homeassistant/components/zoneminder/switch.py b/homeassistant/components/zoneminder/switch.py index b039d2e3ce9..b411a148d43 100644 --- a/homeassistant/components/zoneminder/switch.py +++ b/homeassistant/components/zoneminder/switch.py @@ -1,9 +1,4 @@ -""" -Support for ZoneMinder switches. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.zoneminder/ -""" +"""Support for ZoneMinder switches.""" import logging import voluptuous as vol @@ -33,7 +28,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): for zm_client in hass.data[ZONEMINDER_DOMAIN].values(): monitors = zm_client.get_monitors() if not monitors: - _LOGGER.warning('Could not fetch monitors from ZoneMinder') + _LOGGER.warning("Could not fetch monitors from ZoneMinder") return for monitor in monitors: diff --git a/homeassistant/components/zwave/__init__.py b/homeassistant/components/zwave/__init__.py index 093e6071bb4..be76eca4efd 100644 --- a/homeassistant/components/zwave/__init__.py +++ b/homeassistant/components/zwave/__init__.py @@ -1,9 +1,4 @@ -""" -Support for Z-Wave. - -For more details about this component, please refer to the documentation at -https://home-assistant.io/components/zwave/ -""" +"""Support for Z-Wave.""" import asyncio import copy import logging diff --git a/homeassistant/components/zwave/binary_sensor.py b/homeassistant/components/zwave/binary_sensor.py index ca07986976d..478bfcbda7b 100644 --- a/homeassistant/components/zwave/binary_sensor.py +++ b/homeassistant/components/zwave/binary_sensor.py @@ -1,9 +1,4 @@ -""" -Interfaces with Z-Wave sensors. - -For more details about this platform, please refer to the documentation -https://home-assistant.io/components/binary_sensor.zwave/ -""" +"""Support for Z-Wave binary sensors.""" import logging import datetime import homeassistant.util.dt as dt_util @@ -17,11 +12,10 @@ from homeassistant.components.binary_sensor import ( BinarySensorDevice) _LOGGER = logging.getLogger(__name__) -DEPENDENCIES = [] -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Old method of setting up Z-Wave binary sensors.""" pass @@ -33,8 +27,8 @@ async def async_setup_entry(hass, config_entry, async_add_entities): """Add Z-Wave binary sensor.""" async_add_entities([binary_sensor]) - async_dispatcher_connect(hass, 'zwave_new_binary_sensor', - async_add_binary_sensor) + async_dispatcher_connect( + hass, 'zwave_new_binary_sensor', async_add_binary_sensor) def get_device(values, **kwargs): diff --git a/homeassistant/components/zwave/climate.py b/homeassistant/components/zwave/climate.py index 561af9c9f57..bf7b64549ac 100644 --- a/homeassistant/components/zwave/climate.py +++ b/homeassistant/components/zwave/climate.py @@ -1,9 +1,4 @@ -""" -Support for Z-Wave climate devices. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/climate.zwave/ -""" +"""Support for Z-Wave climate devices.""" # Because we do not compile openzwave on CI import logging from homeassistant.core import callback @@ -43,8 +38,8 @@ STATE_MAPPINGS = { } -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Old method of setting up Z-Wave climate devices.""" pass diff --git a/homeassistant/components/zwave/cover.py b/homeassistant/components/zwave/cover.py index 835305449e8..e40a885ede1 100644 --- a/homeassistant/components/zwave/cover.py +++ b/homeassistant/components/zwave/cover.py @@ -1,9 +1,4 @@ -""" -Support for Z-Wave cover components. - -For more details about this platform, please refer to the documentation -https://home-assistant.io/components/cover.zwave/ -""" +"""Support for Z-Wave covers.""" import logging from homeassistant.core import callback from homeassistant.components.cover import ( @@ -19,8 +14,8 @@ _LOGGER = logging.getLogger(__name__) SUPPORT_GARAGE = SUPPORT_OPEN | SUPPORT_CLOSE -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Old method of setting up Z-Wave covers.""" pass diff --git a/homeassistant/components/zwave/discovery_schemas.py b/homeassistant/components/zwave/discovery_schemas.py index 56d63d658a9..0141f4392dd 100644 --- a/homeassistant/components/zwave/discovery_schemas.py +++ b/homeassistant/components/zwave/discovery_schemas.py @@ -1,4 +1,4 @@ -"""Zwave discovery schemas.""" +"""Z-Wave discovery schemas.""" from . import const DEFAULT_VALUES_SCHEMA = { diff --git a/homeassistant/components/zwave/fan.py b/homeassistant/components/zwave/fan.py index 4b4204aa454..b2731f7d9a7 100644 --- a/homeassistant/components/zwave/fan.py +++ b/homeassistant/components/zwave/fan.py @@ -1,9 +1,4 @@ -""" -Z-Wave platform that handles fans. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/fan.zwave/ -""" +"""Support for Z-Wave fans.""" import logging import math @@ -36,8 +31,8 @@ SPEED_TO_VALUE = { } -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Old method of setting up Z-Wave fans.""" pass diff --git a/homeassistant/components/zwave/light.py b/homeassistant/components/zwave/light.py index da712a2f183..0af85b84177 100644 --- a/homeassistant/components/zwave/light.py +++ b/homeassistant/components/zwave/light.py @@ -1,9 +1,4 @@ -""" -Support for Z-Wave lights. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/light.zwave/ -""" +"""Support for Z-Wave lights.""" import logging from threading import Timer @@ -55,8 +50,8 @@ TEMP_WARM_HASS = (TEMP_COLOR_MAX - TEMP_COLOR_MIN) / 3 * 2 + TEMP_COLOR_MIN TEMP_COLD_HASS = (TEMP_COLOR_MAX - TEMP_COLOR_MIN) / 3 + TEMP_COLOR_MIN -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Old method of setting up Z-Wave lights.""" pass diff --git a/homeassistant/components/zwave/lock.py b/homeassistant/components/zwave/lock.py index b19b06761c4..7c0958e596a 100644 --- a/homeassistant/components/zwave/lock.py +++ b/homeassistant/components/zwave/lock.py @@ -1,9 +1,4 @@ -""" -Z-Wave platform that handles simple door locks. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/lock.zwave/ -""" +"""Support for Z-Wave door locks.""" import logging import voluptuous as vol diff --git a/homeassistant/components/zwave/sensor.py b/homeassistant/components/zwave/sensor.py index ce25b61146b..44fc132cf77 100644 --- a/homeassistant/components/zwave/sensor.py +++ b/homeassistant/components/zwave/sensor.py @@ -1,9 +1,4 @@ -""" -Interfaces with Z-Wave sensors. - -For more details about this platform, please refer to the documentation -at https://home-assistant.io/components/sensor.zwave/ -""" +"""Support for Z-Wave sensors.""" import logging from homeassistant.core import callback from homeassistant.components.sensor import DOMAIN @@ -14,8 +9,8 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect _LOGGER = logging.getLogger(__name__) -async def async_setup_platform(hass, config, async_add_entities, - discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Old method of setting up Z-Wave sensors.""" pass diff --git a/homeassistant/components/zwave/switch.py b/homeassistant/components/zwave/switch.py index 54a2a729d04..ef544222546 100644 --- a/homeassistant/components/zwave/switch.py +++ b/homeassistant/components/zwave/switch.py @@ -1,9 +1,4 @@ -""" -Z-Wave platform that handles simple binary switches. - -For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/switch.zwave/ -""" +"""Support for Z-Wave switches.""" import logging import time from homeassistant.core import callback diff --git a/homeassistant/components/zwave/workaround.py b/homeassistant/components/zwave/workaround.py index 0a882a093c6..ff4db3c0706 100644 --- a/homeassistant/components/zwave/workaround.py +++ b/homeassistant/components/zwave/workaround.py @@ -1,4 +1,4 @@ -"""Zwave workarounds.""" +"""Z-Wave workarounds.""" from . import const # Manufacturers