Update file header (#21054)

* Update file header

* Update __init__.py
This commit is contained in:
Fabian Affolter 2019-02-14 05:35:12 +01:00 committed by Paulus Schoutsen
parent 3a386e627e
commit 161c368c9d
165 changed files with 482 additions and 1346 deletions

View file

@ -1,9 +1,4 @@
""" """Support for Hydrawise cloud."""
Support for Hydrawise cloud.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/hydrawise/
"""
from datetime import timedelta from datetime import timedelta
import logging import logging

View file

@ -1,9 +1,4 @@
""" """Support for Hydrawise sprinkler binary sensors."""
Support for Hydrawise sprinkler.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.hydrawise/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol

View file

@ -1,9 +1,4 @@
""" """Support for Hydrawise sprinkler sensors."""
Support for Hydrawise sprinkler.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.hydrawise/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol

View file

@ -1,9 +1,4 @@
""" """Support for Hydrawise cloud switches."""
Support for Hydrawise cloud.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.hydrawise/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol
@ -36,12 +31,10 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
sensors = [] sensors = []
for sensor_type in config.get(CONF_MONITORED_CONDITIONS): for sensor_type in config.get(CONF_MONITORED_CONDITIONS):
# create a switch for each zone # Create a switch for each zone
for zone in hydrawise.relays: for zone in hydrawise.relays:
sensors.append( sensors.append(
HydrawiseSwitch(default_watering_timer, HydrawiseSwitch(default_watering_timer, zone, sensor_type))
zone,
sensor_type))
add_entities(sensors, True) add_entities(sensors, True)

View file

@ -1,8 +1,4 @@
"""Component for interfacing RFK101 proximity card readers. """Component for interfacing RFK101 proximity card readers."""
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/idteck_prox/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol

View file

@ -1,9 +1,4 @@
""" """Support to trigger Maker IFTTT recipes."""
Support to trigger Maker IFTTT recipes.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/ifttt/
"""
import json import json
import logging import logging

View file

@ -1,9 +1,4 @@
""" """Support for alarm control panels that can be controlled through IFTTT."""
Interfaces with alarm control panels that have to be controlled through IFTTT.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.ifttt/
"""
import logging import logging
import re import re

View file

@ -1,9 +1,4 @@
""" """Support for sending data to an Influx database."""
A component which allows you to send data to an Influx database.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/influxdb/
"""
import logging import logging
import re import re
import queue import queue

View file

@ -1,9 +1,4 @@
""" """Support to keep track of user controlled booleans for within automation."""
Component to keep track of user controlled booleans for within automation.
For more details about this component, please refer to the documentation
at https://home-assistant.io/components/input_boolean/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol

View file

@ -1,9 +1,4 @@
""" """Support to select a date and/or a time."""
Component to offer a way to select a date and / or a time.
For more details about this component, please refer to the documentation
at https://home-assistant.io/components/input_datetime/
"""
import logging import logging
import datetime import datetime

View file

@ -1,9 +1,4 @@
""" """Support to set a numeric value from a slider or text box."""
Component to offer a way to set a numeric value from a slider or text box.
For more details about this component, please refer to the documentation
at https://home-assistant.io/components/input_number/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol

View file

@ -1,9 +1,4 @@
""" """Support to select an option from a list."""
Component to offer a way to select an option from a list.
For more details about this component, please refer to the documentation
at https://home-assistant.io/components/input_select/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol

View file

@ -1,9 +1,4 @@
""" """Support to enter a value into a text box."""
Component to offer a way to enter a value into a text box.
For more details about this component, please refer to the documentation
at https://home-assistant.io/components/input_text/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol

View file

@ -1,9 +1,4 @@
""" """Local support for Insteon."""
Local support for Insteon.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/insteon_local/
"""
import logging import logging
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View file

@ -1,9 +1,4 @@
""" """Support for INSTEON PowerLinc Modem."""
Support for INSTEON PowerLinc Modem.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/insteon_plm/
"""
import logging import logging
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View file

@ -1,9 +1,4 @@
""" """Component that will help guide the user taking its first steps."""
Component that will help guide the user taking its first steps.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/introduction/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol

View file

@ -1,9 +1,4 @@
""" """Support for IOTA wallets."""
Support for IOTA wallets.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/iota/
"""
import logging import logging
from datetime import timedelta from datetime import timedelta

View file

@ -1,9 +1,4 @@
""" """Support for IOTA wallet sensors."""
Support for IOTA wallets.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/iota
"""
import logging import logging
from datetime import timedelta from datetime import timedelta
@ -26,12 +21,10 @@ SCAN_INTERVAL = timedelta(minutes=3)
def setup_platform(hass, config, add_entities, discovery_info=None): def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the IOTA sensor.""" """Set up the IOTA sensor."""
# Add sensors for wallet balance
iota_config = discovery_info iota_config = discovery_info
sensors = [IotaBalanceSensor(wallet, iota_config) sensors = [IotaBalanceSensor(wallet, iota_config)
for wallet in iota_config[CONF_WALLETS]] for wallet in iota_config[CONF_WALLETS]]
# Add sensor for node information
sensors.append(IotaNodeSensor(iota_config=iota_config)) sensors.append(IotaNodeSensor(iota_config=iota_config))
add_entities(sensors) add_entities(sensors)

View file

@ -1,5 +1 @@
"""The itach component. """Support for itach devices."""
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/itach/
"""

View file

@ -1,10 +1,4 @@
""" """Support for iTach IR devices."""
Support for iTach IR Devices.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/remote.itach/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol
@ -38,7 +32,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_CONNADDR): vol.Coerce(int), vol.Required(CONF_CONNADDR): vol.Coerce(int),
vol.Required(CONF_COMMANDS): vol.All(cv.ensure_list, [{ vol.Required(CONF_COMMANDS): vol.All(cv.ensure_list, [{
vol.Required(CONF_NAME): cv.string, vol.Required(CONF_NAME): cv.string,
vol.Required(CONF_DATA): cv.string vol.Required(CONF_DATA): cv.string,
}]) }])
}]) }])
}) })

View file

@ -1,9 +1,4 @@
""" """Support for Joaoapps Join services."""
Component for Joaoapps Join services.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/join/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol
@ -16,6 +11,7 @@ REQUIREMENTS = ['python-join-api==0.0.2']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
DOMAIN = 'joaoapps_join' DOMAIN = 'joaoapps_join'
CONF_DEVICE_ID = 'device_id' CONF_DEVICE_ID = 'device_id'
CONF_DEVICE_IDS = 'device_ids' CONF_DEVICE_IDS = 'device_ids'
CONF_DEVICE_NAMES = 'device_names' CONF_DEVICE_NAMES = 'device_names'
@ -26,7 +22,7 @@ CONFIG_SCHEMA = vol.Schema({
vol.Optional(CONF_DEVICE_ID): cv.string, vol.Optional(CONF_DEVICE_ID): cv.string,
vol.Optional(CONF_DEVICE_IDS): cv.string, vol.Optional(CONF_DEVICE_IDS): cv.string,
vol.Optional(CONF_DEVICE_NAMES): cv.string, vol.Optional(CONF_DEVICE_NAMES): cv.string,
vol.Optional(CONF_NAME): cv.string vol.Optional(CONF_NAME): cv.string,
}]) }])
}, extra=vol.ALLOW_EXTRA) }, extra=vol.ALLOW_EXTRA)

View file

@ -1,9 +1,4 @@
""" """Support for Join notifications."""
Join platform for notify component.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.join/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol
from homeassistant.components.notify import ( from homeassistant.components.notify import (

View file

@ -1,10 +1,4 @@
""" """Support for Juicenet cloud."""
Support for Juicenet cloud.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/juicenet
"""
import logging import logging
import voluptuous as vol import voluptuous as vol
@ -22,7 +16,7 @@ DOMAIN = 'juicenet'
CONFIG_SCHEMA = vol.Schema({ CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.Schema({ DOMAIN: vol.Schema({
vol.Required(CONF_ACCESS_TOKEN): cv.string vol.Required(CONF_ACCESS_TOKEN): cv.string,
}) })
}, extra=vol.ALLOW_EXTRA) }, extra=vol.ALLOW_EXTRA)

View file

@ -1,19 +1,14 @@
""" """Support for monitoring juicenet/juicepoint/juicebox based EVSE sensors."""
Support for monitoring juicenet/juicepoint/juicebox based EVSE sensors.
For more details about this platform, please refer to the documentation at
at https://home-assistant.io/components/sensor.juicenet/
"""
import logging import logging
from homeassistant.const import TEMP_CELSIUS from homeassistant.const import TEMP_CELSIUS
from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity import Entity
from homeassistant.components.juicenet import JuicenetDevice, DOMAIN from homeassistant.components.juicenet import JuicenetDevice, DOMAIN
DEPENDENCIES = ['juicenet']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['juicenet']
SENSOR_TYPES = { SENSOR_TYPES = {
'status': ['Charging Status', None], 'status': ['Charging Status', None],
'temperature': ['Temperature', TEMP_CELSIUS], 'temperature': ['Temperature', TEMP_CELSIUS],

View file

@ -1,9 +1,4 @@
""" """Support to emulate keyboard presses on host machine."""
Provides functionality to emulate keyboard presses on host machine.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/keyboard/
"""
import voluptuous as vol import voluptuous as vol
from homeassistant.const import ( from homeassistant.const import (

View file

@ -1,9 +1,4 @@
""" """Receive signals from a keyboard and use it as a remote control."""
Receive signals from a keyboard and use it as a remote control.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/keyboard_remote/
"""
# pylint: disable=import-error # pylint: disable=import-error
import threading import threading
import logging import logging

View file

@ -1,9 +1,4 @@
""" """KIRA interface to receive UDP packets from an IR-IP bridge."""
KIRA interface to receive UDP packets from an IR-IP bridge.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/kira/
"""
import logging import logging
import os import os
@ -13,7 +8,7 @@ import yaml
from homeassistant.const import ( from homeassistant.const import (
CONF_DEVICE, CONF_HOST, CONF_NAME, CONF_PORT, CONF_SENSORS, CONF_TYPE, CONF_DEVICE, CONF_HOST, CONF_NAME, CONF_PORT, CONF_SENSORS, CONF_TYPE,
EVENT_HOMEASSISTANT_STOP, STATE_UNKNOWN) EVENT_HOMEASSISTANT_STOP, STATE_UNKNOWN, CONF_CODE)
from homeassistant.helpers import discovery from homeassistant.helpers import discovery
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
@ -26,7 +21,6 @@ _LOGGER = logging.getLogger(__name__)
DEFAULT_HOST = "0.0.0.0" DEFAULT_HOST = "0.0.0.0"
DEFAULT_PORT = 65432 DEFAULT_PORT = 65432
CONF_CODE = "code"
CONF_REPEAT = "repeat" CONF_REPEAT = "repeat"
CONF_REMOTES = "remotes" CONF_REMOTES = "remotes"
CONF_SENSOR = "sensor" CONF_SENSOR = "sensor"

View file

@ -1,9 +1,4 @@
""" """Support for Keene Electronics IR-IP devices."""
Support for Keene Electronics IR-IP devices.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/remote.kira/
"""
import functools as ft import functools as ft
import logging import logging
@ -15,7 +10,7 @@ DOMAIN = 'kira'
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
CONF_REMOTE = "remote" CONF_REMOTE = 'remote'
def setup_platform(hass, config, add_entities, discovery_info=None): def setup_platform(hass, config, add_entities, discovery_info=None):

View file

@ -1,9 +1,4 @@
""" """KIRA interface to receive UDP packets from an IR-IP bridge."""
KIRA interface to receive UDP packets from an IR-IP bridge.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.kira/
"""
import logging import logging
from homeassistant.const import CONF_DEVICE, CONF_NAME, STATE_UNKNOWN from homeassistant.const import CONF_DEVICE, CONF_NAME, STATE_UNKNOWN

View file

@ -1,10 +1,4 @@
""" """Support KNX devices."""
Connects to KNX platform.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/knx/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol
@ -19,6 +13,8 @@ from homeassistant.helpers.script import Script
REQUIREMENTS = ['xknx==0.9.4'] REQUIREMENTS = ['xknx==0.9.4']
_LOGGER = logging.getLogger(__name__)
DOMAIN = "knx" DOMAIN = "knx"
DATA_KNX = "data_knx" DATA_KNX = "data_knx"
CONF_KNX_CONFIG = "config_file" CONF_KNX_CONFIG = "config_file"
@ -39,8 +35,6 @@ SERVICE_KNX_ATTR_PAYLOAD = "payload"
ATTR_DISCOVER_DEVICES = 'devices' ATTR_DISCOVER_DEVICES = 'devices'
_LOGGER = logging.getLogger(__name__)
TUNNELING_SCHEMA = vol.Schema({ TUNNELING_SCHEMA = vol.Schema({
vol.Required(CONF_HOST): cv.string, vol.Required(CONF_HOST): cv.string,
vol.Required(CONF_KNX_LOCAL_IP): cv.string, vol.Required(CONF_KNX_LOCAL_IP): cv.string,

View file

@ -1,10 +1,4 @@
""" """Support for KNX/IP binary sensors."""
Support for KNX/IP binary sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.knx/
"""
import voluptuous as vol import voluptuous as vol
from homeassistant.components.binary_sensor import ( from homeassistant.components.binary_sensor import (
@ -35,7 +29,7 @@ DEPENDENCIES = ['knx']
AUTOMATION_SCHEMA = vol.Schema({ AUTOMATION_SCHEMA = vol.Schema({
vol.Optional(CONF_HOOK, default=CONF_DEFAULT_HOOK): cv.string, vol.Optional(CONF_HOOK, default=CONF_DEFAULT_HOOK): cv.string,
vol.Optional(CONF_COUNTER, default=CONF_DEFAULT_COUNTER): cv.port, vol.Optional(CONF_COUNTER, default=CONF_DEFAULT_COUNTER): cv.port,
vol.Required(CONF_ACTION): cv.SCRIPT_SCHEMA vol.Required(CONF_ACTION): cv.SCRIPT_SCHEMA,
}) })
AUTOMATIONS_SCHEMA = vol.All( AUTOMATIONS_SCHEMA = vol.All(

View file

@ -1,10 +1,4 @@
""" """Support for KNX/IP climate devices."""
Support for KNX/IP climate devices.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/climate.knx/
"""
import voluptuous as vol import voluptuous as vol
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from homeassistant.components.climate import ( from homeassistant.components.climate import (

View file

@ -1,10 +1,4 @@
""" """Support for KNX/IP covers."""
Support for KNX/IP covers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/cover.knx/
"""
import voluptuous as vol import voluptuous as vol
from homeassistant.components.cover import ( from homeassistant.components.cover import (
@ -49,8 +43,8 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
}) })
async def async_setup_platform(hass, config, async_add_entities, async def async_setup_platform(
discovery_info=None): hass, config, async_add_entities, discovery_info=None):
"""Set up cover(s) for KNX platform.""" """Set up cover(s) for KNX platform."""
if discovery_info is not None: if discovery_info is not None:
async_add_entities_discovery(hass, discovery_info, async_add_entities) async_add_entities_discovery(hass, discovery_info, async_add_entities)

View file

@ -1,9 +1,4 @@
""" """Support for KNX/IP lights."""
Support for KNX/IP lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.knx/
"""
from enum import Enum from enum import Enum
import voluptuous as vol import voluptuous as vol

View file

@ -1,10 +1,4 @@
""" """Support for KNX/IP notification services."""
KNX/IP notification service.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/notify.knx/
"""
import voluptuous as vol import voluptuous as vol
from homeassistant.components.knx import DATA_KNX, ATTR_DISCOVER_DEVICES from homeassistant.components.knx import DATA_KNX, ATTR_DISCOVER_DEVICES
@ -16,6 +10,7 @@ import homeassistant.helpers.config_validation as cv
CONF_ADDRESS = 'address' CONF_ADDRESS = 'address'
DEFAULT_NAME = 'KNX Notify' DEFAULT_NAME = 'KNX Notify'
DEPENDENCIES = ['knx'] DEPENDENCIES = ['knx']
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({

View file

@ -1,9 +1,4 @@
""" """Support for KNX scenes."""
Support for KNX scenes.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/scene.knx/
"""
import voluptuous as vol import voluptuous as vol
from homeassistant.components.knx import ATTR_DISCOVER_DEVICES, DATA_KNX from homeassistant.components.knx import ATTR_DISCOVER_DEVICES, DATA_KNX
@ -26,8 +21,8 @@ PLATFORM_SCHEMA = vol.Schema({
}) })
async def async_setup_platform(hass, config, async_add_entities, async def async_setup_platform(
discovery_info=None): hass, config, async_add_entities, discovery_info=None):
"""Set up the scenes for KNX platform.""" """Set up the scenes for KNX platform."""
if discovery_info is not None: if discovery_info is not None:
async_add_entities_discovery(hass, discovery_info, async_add_entities) async_add_entities_discovery(hass, discovery_info, async_add_entities)

View file

@ -1,10 +1,4 @@
""" """Support for KNX/IP sensors."""
Support for KNX/IP sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.knx/
"""
import voluptuous as vol import voluptuous as vol
from homeassistant.components.knx import ATTR_DISCOVER_DEVICES, DATA_KNX from homeassistant.components.knx import ATTR_DISCOVER_DEVICES, DATA_KNX

View file

@ -1,10 +1,4 @@
""" """Support for KNX/IP switches."""
Support for KNX/IP switches.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.knx/
"""
import voluptuous as vol import voluptuous as vol
from homeassistant.components.knx import ATTR_DISCOVER_DEVICES, DATA_KNX from homeassistant.components.knx import ATTR_DISCOVER_DEVICES, DATA_KNX

View file

@ -1,9 +1,4 @@
""" """Support for Konnected devices."""
Support for Konnected devices.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/konnected/
"""
import asyncio import asyncio
import hmac import hmac
import json import json

View file

@ -1,9 +1,4 @@
""" """Support for wired binary sensors attached to a Konnected device."""
Support for wired binary sensors attached to a Konnected device.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.konnected/
"""
import logging import logging
from homeassistant.components.binary_sensor import BinarySensorDevice from homeassistant.components.binary_sensor import BinarySensorDevice
@ -20,8 +15,8 @@ _LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['konnected'] DEPENDENCIES = ['konnected']
async def async_setup_platform(hass, config, async_add_entities, async def async_setup_platform(
discovery_info=None): hass, config, async_add_entities, discovery_info=None):
"""Set up binary sensors attached to a Konnected device.""" """Set up binary sensors attached to a Konnected device."""
if discovery_info is None: if discovery_info is None:
return return
@ -38,7 +33,7 @@ class KonnectedBinarySensor(BinarySensorDevice):
"""Representation of a Konnected binary sensor.""" """Representation of a Konnected binary sensor."""
def __init__(self, device_id, pin_num, data): def __init__(self, device_id, pin_num, data):
"""Initialize the binary sensor.""" """Initialize the Konnected binary sensor."""
self._data = data self._data = data
self._device_id = device_id self._device_id = device_id
self._pin_num = pin_num self._pin_num = pin_num
@ -46,7 +41,7 @@ class KonnectedBinarySensor(BinarySensorDevice):
self._device_class = self._data.get(CONF_TYPE) self._device_class = self._data.get(CONF_TYPE)
self._name = self._data.get(CONF_NAME, 'Konnected {} Zone {}'.format( self._name = self._data.get(CONF_NAME, 'Konnected {} Zone {}'.format(
device_id, PIN_TO_ZONE[pin_num])) device_id, PIN_TO_ZONE[pin_num]))
_LOGGER.debug('Created new Konnected sensor: %s', self._name) _LOGGER.debug("Created new Konnected sensor: %s", self._name)
@property @property
def name(self): def name(self):

View file

@ -1,10 +1,4 @@
""" """Support for wired switches attached to a Konnected device."""
Support for wired switches attached to a Konnected device.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.konnected/
"""
import logging import logging
from homeassistant.components.konnected import ( from homeassistant.components.konnected import (
@ -19,8 +13,8 @@ _LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['konnected'] DEPENDENCIES = ['konnected']
async def async_setup_platform(hass, config, async_add_entities, async def async_setup_platform(
discovery_info=None): hass, config, async_add_entities, discovery_info=None):
"""Set switches attached to a Konnected device.""" """Set switches attached to a Konnected device."""
if discovery_info is None: if discovery_info is None:
return return
@ -37,7 +31,7 @@ class KonnectedSwitch(ToggleEntity):
"""Representation of a Konnected switch.""" """Representation of a Konnected switch."""
def __init__(self, device_id, pin_num, data): def __init__(self, device_id, pin_num, data):
"""Initialize the switch.""" """Initialize the Konnected switch."""
self._data = data self._data = data
self._device_id = device_id self._device_id = device_id
self._pin_num = pin_num self._pin_num = pin_num
@ -49,7 +43,7 @@ class KonnectedSwitch(ToggleEntity):
self._name = self._data.get( self._name = self._data.get(
'name', 'Konnected {} Actuator {}'.format( 'name', 'Konnected {} Actuator {}'.format(
device_id, PIN_TO_ZONE[pin_num])) device_id, PIN_TO_ZONE[pin_num]))
_LOGGER.debug('Created new switch: %s', self._name) _LOGGER.debug("Created new switch: %s", self._name)
@property @property
def name(self): def name(self):

View file

@ -1,12 +1,4 @@
""" """Support for LaMetric time."""
Support for LaMetric time.
This is the base platform to support LaMetric components:
Notify, Light, Mediaplayer
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/lametric/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol

View file

@ -1,9 +1,4 @@
""" """Support for LaMetric notifications."""
Notifier for LaMetric time.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.lametric/
"""
import logging import logging
from requests.exceptions import ConnectionError as RequestsConnectionError from requests.exceptions import ConnectionError as RequestsConnectionError
@ -17,33 +12,32 @@ import homeassistant.helpers.config_validation as cv
from homeassistant.components.lametric import DOMAIN as LAMETRIC_DOMAIN from homeassistant.components.lametric import DOMAIN as LAMETRIC_DOMAIN
REQUIREMENTS = ['lmnotify==0.0.4'] REQUIREMENTS = ['lmnotify==0.0.4']
DEPENDENCIES = ['lametric']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
CONF_LIFETIME = "lifetime" AVAILABLE_PRIORITIES = ['info', 'warning', 'critical']
CONF_CYCLES = "cycles"
CONF_PRIORITY = "priority"
AVAILABLE_PRIORITIES = ["info", "warning", "critical"] CONF_CYCLES = 'cycles'
CONF_LIFETIME = 'lifetime'
CONF_PRIORITY = 'priority'
DEPENDENCIES = ['lametric']
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_ICON, default="i555"): cv.string, vol.Optional(CONF_ICON, default='i555'): cv.string,
vol.Optional(CONF_LIFETIME, default=10): cv.positive_int, vol.Optional(CONF_LIFETIME, default=10): cv.positive_int,
vol.Optional(CONF_CYCLES, default=1): cv.positive_int, vol.Optional(CONF_CYCLES, default=1): cv.positive_int,
vol.Optional(CONF_PRIORITY, default="warning"): vol.Optional(CONF_PRIORITY, default='warning'):
vol.In(AVAILABLE_PRIORITIES) vol.In(AVAILABLE_PRIORITIES),
}) })
def get_service(hass, config, discovery_info=None): def get_service(hass, config, discovery_info=None):
"""Get the LaMetric notification service.""" """Get the LaMetric notification service."""
hlmn = hass.data.get(LAMETRIC_DOMAIN) hlmn = hass.data.get(LAMETRIC_DOMAIN)
return LaMetricNotificationService(hlmn, return LaMetricNotificationService(
config[CONF_ICON], hlmn, config[CONF_ICON], config[CONF_LIFETIME] * 1000,
config[CONF_LIFETIME] * 1000, config[CONF_CYCLES], config[CONF_PRIORITY])
config[CONF_CYCLES],
config[CONF_PRIORITY])
class LaMetricNotificationService(BaseNotificationService): class LaMetricNotificationService(BaseNotificationService):

View file

@ -1,10 +1,4 @@
""" """Support for LCN devices."""
Connects to LCN platform.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/lcn/
"""
import logging import logging
import re import re

View file

@ -1,10 +1,4 @@
""" """Support for LCN lights."""
Support for LCN lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.lcn/
"""
from homeassistant.components.lcn import ( from homeassistant.components.lcn import (
CONF_CONNECTIONS, CONF_DIMMABLE, CONF_OUTPUT, CONF_TRANSITION, DATA_LCN, CONF_CONNECTIONS, CONF_DIMMABLE, CONF_OUTPUT, CONF_TRANSITION, DATA_LCN,
OUTPUT_PORTS, LcnDevice, get_connection) OUTPUT_PORTS, LcnDevice, get_connection)
@ -16,8 +10,8 @@ from homeassistant.const import CONF_ADDRESS
DEPENDENCIES = ['lcn'] DEPENDENCIES = ['lcn']
async def async_setup_platform(hass, hass_config, async_add_entities, async def async_setup_platform(
discovery_info=None): hass, hass_config, async_add_entities, discovery_info=None):
"""Set up the LCN light platform.""" """Set up the LCN light platform."""
if discovery_info is None: if discovery_info is None:
return return

View file

@ -1,10 +1,4 @@
""" """Support for LCN switches."""
Support for LCN switches.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.lcn/
"""
from homeassistant.components.lcn import ( from homeassistant.components.lcn import (
CONF_CONNECTIONS, CONF_OUTPUT, DATA_LCN, OUTPUT_PORTS, LcnDevice, CONF_CONNECTIONS, CONF_OUTPUT, DATA_LCN, OUTPUT_PORTS, LcnDevice,
get_connection) get_connection)

View file

@ -1,4 +1,4 @@
"""Component to embed LIFX.""" """Support for LIFX."""
import voluptuous as vol import voluptuous as vol
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
@ -7,7 +7,6 @@ from homeassistant.const import CONF_PORT
from homeassistant.helpers import config_entry_flow from homeassistant.helpers import config_entry_flow
from homeassistant.components.light import DOMAIN as LIGHT_DOMAIN from homeassistant.components.light import DOMAIN as LIGHT_DOMAIN
DOMAIN = 'lifx' DOMAIN = 'lifx'
REQUIREMENTS = ['aiolifx==0.6.7'] REQUIREMENTS = ['aiolifx==0.6.7']

View file

@ -1,9 +1,4 @@
""" """Support for LIFX lights."""
Support for the LIFX platform that implements lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.lifx/
"""
import asyncio import asyncio
from datetime import timedelta from datetime import timedelta
from functools import partial from functools import partial

View file

@ -1,9 +1,4 @@
""" """Support for device connected via Lightwave WiFi-link hub."""
Support for device connected via Lightwave WiFi-link hub.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/lightwave/
"""
import voluptuous as vol import voluptuous as vol
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from homeassistant.const import (CONF_HOST, CONF_LIGHTS, CONF_NAME, from homeassistant.const import (CONF_HOST, CONF_LIGHTS, CONF_NAME,
@ -11,7 +6,9 @@ from homeassistant.const import (CONF_HOST, CONF_LIGHTS, CONF_NAME,
from homeassistant.helpers.discovery import async_load_platform from homeassistant.helpers.discovery import async_load_platform
REQUIREMENTS = ['lightwave==0.15'] REQUIREMENTS = ['lightwave==0.15']
LIGHTWAVE_LINK = 'lightwave_link' LIGHTWAVE_LINK = 'lightwave_link'
DOMAIN = 'lightwave' DOMAIN = 'lightwave'

View file

@ -1,9 +1,4 @@
""" """Support for LightwaveRF lights."""
Implements LightwaveRF lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.lightwave/
"""
from homeassistant.components.light import ( from homeassistant.components.light import (
ATTR_BRIGHTNESS, SUPPORT_BRIGHTNESS, Light) ATTR_BRIGHTNESS, SUPPORT_BRIGHTNESS, Light)
from homeassistant.components.lightwave import LIGHTWAVE_LINK from homeassistant.components.lightwave import LIGHTWAVE_LINK
@ -14,8 +9,8 @@ DEPENDENCIES = ['lightwave']
MAX_BRIGHTNESS = 255 MAX_BRIGHTNESS = 255
async def async_setup_platform(hass, config, async_add_entities, async def async_setup_platform(
discovery_info=None): hass, config, async_add_entities, discovery_info=None):
"""Find and return LightWave lights.""" """Find and return LightWave lights."""
if not discovery_info: if not discovery_info:
return return

View file

@ -1,9 +1,4 @@
""" """Support for LightwaveRF switches."""
Implements LightwaveRF switches.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.lightwave/
"""
from homeassistant.components.lightwave import LIGHTWAVE_LINK from homeassistant.components.lightwave import LIGHTWAVE_LINK
from homeassistant.components.switch import SwitchDevice from homeassistant.components.switch import SwitchDevice
from homeassistant.const import CONF_NAME from homeassistant.const import CONF_NAME
@ -11,8 +6,8 @@ from homeassistant.const import CONF_NAME
DEPENDENCIES = ['lightwave'] DEPENDENCIES = ['lightwave']
async def async_setup_platform(hass, config, async_add_entities, async def async_setup_platform(
discovery_info=None): hass, config, async_add_entities, discovery_info=None):
"""Find and return LightWave switches.""" """Find and return LightWave switches."""
if not discovery_info: if not discovery_info:
return return

View file

@ -1,17 +1,12 @@
""" """Support for Linode."""
Support for Linode.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/linode/
"""
import logging
from datetime import timedelta from datetime import timedelta
import logging
import voluptuous as vol import voluptuous as vol
from homeassistant.const import CONF_ACCESS_TOKEN from homeassistant.const import CONF_ACCESS_TOKEN
from homeassistant.util import Throttle
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from homeassistant.util import Throttle
REQUIREMENTS = ['linode-api==4.1.9b1'] REQUIREMENTS = ['linode-api==4.1.9b1']

View file

@ -1,20 +1,15 @@
""" """Support for monitoring the state of Linode Nodes."""
Support for monitoring the state of Linode Nodes.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.linode/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.binary_sensor import ( from homeassistant.components.binary_sensor import (
BinarySensorDevice, PLATFORM_SCHEMA) PLATFORM_SCHEMA, BinarySensorDevice)
from homeassistant.components.linode import ( from homeassistant.components.linode import (
CONF_NODES, ATTR_CREATED, ATTR_NODE_ID, ATTR_NODE_NAME, ATTR_CREATED, ATTR_IPV4_ADDRESS, ATTR_IPV6_ADDRESS, ATTR_MEMORY,
ATTR_IPV4_ADDRESS, ATTR_IPV6_ADDRESS, ATTR_MEMORY, ATTR_NODE_ID, ATTR_NODE_NAME, ATTR_REGION, ATTR_VCPUS, CONF_NODES,
ATTR_REGION, ATTR_VCPUS, DATA_LINODE) DATA_LINODE)
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View file

@ -1,19 +1,14 @@
""" """Support for interacting with Linode nodes."""
Support for interacting with Linode nodes.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/switch.linode/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA)
from homeassistant.components.linode import ( from homeassistant.components.linode import (
CONF_NODES, ATTR_CREATED, ATTR_NODE_ID, ATTR_NODE_NAME, ATTR_CREATED, ATTR_IPV4_ADDRESS, ATTR_IPV6_ADDRESS, ATTR_MEMORY,
ATTR_IPV4_ADDRESS, ATTR_IPV6_ADDRESS, ATTR_MEMORY, ATTR_NODE_ID, ATTR_NODE_NAME, ATTR_REGION, ATTR_VCPUS, CONF_NODES,
ATTR_REGION, ATTR_VCPUS, DATA_LINODE) DATA_LINODE)
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchDevice
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View file

@ -1,9 +1,4 @@
""" """Support for LIRC devices."""
LIRC interface to receive signals from an infrared remote control.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/lirc/
"""
# pylint: disable=no-member, import-error # pylint: disable=no-member, import-error
import threading import threading
import time import time

View file

@ -1,8 +1,4 @@
"""Allows the LiteJet lighting system to be controlled by Home Assistant. """Support for the LiteJet lighting system."""
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/litejet/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol
@ -24,7 +20,7 @@ CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.Schema({ DOMAIN: vol.Schema({
vol.Required(CONF_PORT): cv.string, vol.Required(CONF_PORT): cv.string,
vol.Optional(CONF_EXCLUDE_NAMES): vol.All(cv.ensure_list, [cv.string]), vol.Optional(CONF_EXCLUDE_NAMES): vol.All(cv.ensure_list, [cv.string]),
vol.Optional(CONF_INCLUDE_SWITCHES, default=False): cv.boolean vol.Optional(CONF_INCLUDE_SWITCHES, default=False): cv.boolean,
}) })
}, extra=vol.ALLOW_EXTRA) }, extra=vol.ALLOW_EXTRA)

View file

@ -1,9 +1,4 @@
""" """Support for Locative."""
Support for Locative.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/locative/
"""
import logging import logging
from typing import Dict from typing import Dict

View file

@ -1,9 +1,4 @@
""" """Event parser and human readable log generator."""
Event parser and human readable log generator.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/logbook/
"""
from datetime import timedelta from datetime import timedelta
from itertools import groupby from itertools import groupby
import logging import logging
@ -47,12 +42,12 @@ CONFIG_SCHEMA = vol.Schema({
CONF_EXCLUDE: vol.Schema({ CONF_EXCLUDE: vol.Schema({
vol.Optional(CONF_ENTITIES, default=[]): cv.entity_ids, vol.Optional(CONF_ENTITIES, default=[]): cv.entity_ids,
vol.Optional(CONF_DOMAINS, default=[]): vol.Optional(CONF_DOMAINS, default=[]):
vol.All(cv.ensure_list, [cv.string]) vol.All(cv.ensure_list, [cv.string]),
}), }),
CONF_INCLUDE: vol.Schema({ CONF_INCLUDE: vol.Schema({
vol.Optional(CONF_ENTITIES, default=[]): cv.entity_ids, vol.Optional(CONF_ENTITIES, default=[]): cv.entity_ids,
vol.Optional(CONF_DOMAINS, default=[]): vol.Optional(CONF_DOMAINS, default=[]):
vol.All(cv.ensure_list, [cv.string]) vol.All(cv.ensure_list, [cv.string]),
}) })
}), }),
}, extra=vol.ALLOW_EXTRA) }, extra=vol.ALLOW_EXTRA)

View file

@ -1,9 +1,4 @@
""" """Support for sending data to Logentries webhook endpoint."""
Support for sending data to Logentries webhook endpoint.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/logentries/
"""
import json import json
import logging import logging
import requests import requests
@ -42,19 +37,17 @@ def setup(hass, config):
_state = state_helper.state_as_number(state) _state = state_helper.state_as_number(state)
except ValueError: except ValueError:
_state = state.state _state = state.state
json_body = [ json_body = [{
{
'domain': state.domain, 'domain': state.domain,
'entity_id': state.object_id, 'entity_id': state.object_id,
'attributes': dict(state.attributes), 'attributes': dict(state.attributes),
'time': str(event.time_fired), 'time': str(event.time_fired),
'value': _state, 'value': _state,
} }]
]
try: try:
payload = { payload = {
"host": le_wh, 'host': le_wh,
"event": json_body 'event': json_body
} }
requests.post(le_wh, data=json.dumps(payload), timeout=10) requests.post(le_wh, data=json.dumps(payload), timeout=10)
except requests.exceptions.RequestException as error: except requests.exceptions.RequestException as error:

View file

@ -1,9 +1,4 @@
""" """Support for settting the level of logging for components."""
Component that will help set the level of logging for components.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/logger/
"""
import logging import logging
from collections import OrderedDict from collections import OrderedDict

View file

@ -1,9 +1,4 @@
""" """Support for Logi Circle devices."""
Support for Logi Circle cameras.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/logi_circle/
"""
import logging import logging
import asyncio import asyncio

View file

@ -1,9 +1,4 @@
""" """Support to the Logi Circle cameras."""
This component provides support to the Logi Circle camera.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/camera.logi_circle/
"""
import logging import logging
import asyncio import asyncio
from datetime import timedelta from datetime import timedelta

View file

@ -1,9 +1,4 @@
""" """Support for Logi Circle sensors."""
This component provides HA sensor support for Logi Circle cameras.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.logi_circle/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol
@ -26,26 +21,13 @@ _LOGGER = logging.getLogger(__name__)
# Sensor types: Name, unit of measure, icon per sensor key. # Sensor types: Name, unit of measure, icon per sensor key.
SENSOR_TYPES = { SENSOR_TYPES = {
'battery_level': [ 'battery_level': ['Battery', '%', 'battery-50'],
'Battery', '%', 'battery-50'], 'last_activity_time': ['Last Activity', None, 'history'],
'privacy_mode': ['Privacy Mode', None, 'eye'],
'last_activity_time': [ 'signal_strength_category': ['WiFi Signal Category', None, 'wifi'],
'Last Activity', None, 'history'], 'signal_strength_percentage': ['WiFi Signal Strength', '%', 'wifi'],
'speaker_volume': ['Volume', '%', 'volume-high'],
'privacy_mode': [ 'streaming_mode': ['Streaming Mode', None, 'camera'],
'Privacy Mode', None, 'eye'],
'signal_strength_category': [
'WiFi Signal Category', None, 'wifi'],
'signal_strength_percentage': [
'WiFi Signal Strength', '%', 'wifi'],
'speaker_volume': [
'Volume', '%', 'volume-high'],
'streaming_mode': [
'Streaming Mode', None, 'camera'],
} }
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({

View file

@ -1,9 +1,4 @@
""" """Support for the Lovelace UI."""
Support for the Lovelace UI.
For more details about this component, please refer to the documentation
at https://www.home-assistant.io/lovelace/
"""
from functools import wraps from functools import wraps
import logging import logging
import os import os

View file

@ -1,9 +1,4 @@
""" """Support for Luftdaten stations."""
Support for Luftdaten stations.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/luftdaten/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol

View file

@ -1,9 +1,4 @@
""" """Support for Luftdaten sensors."""
Support for Luftdaten sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.luftdaten/
"""
import logging import logging
from homeassistant.components.luftdaten import ( from homeassistant.components.luftdaten import (

View file

@ -1,10 +1,4 @@
""" """Support for Lupusec Home Security system."""
This component provides basic support for Lupusec Home Security system.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/lupusec
"""
import logging import logging
import voluptuous as vol import voluptuous as vol
@ -14,6 +8,7 @@ from homeassistant.helpers import discovery
from homeassistant.const import (CONF_USERNAME, CONF_PASSWORD, from homeassistant.const import (CONF_USERNAME, CONF_PASSWORD,
CONF_NAME, CONF_IP_ADDRESS) CONF_NAME, CONF_IP_ADDRESS)
from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
REQUIREMENTS = ['lupupy==0.0.17'] REQUIREMENTS = ['lupupy==0.0.17']
@ -28,7 +23,7 @@ CONFIG_SCHEMA = vol.Schema({
vol.Required(CONF_USERNAME): cv.string, vol.Required(CONF_USERNAME): cv.string,
vol.Required(CONF_PASSWORD): cv.string, vol.Required(CONF_PASSWORD): cv.string,
vol.Required(CONF_IP_ADDRESS): cv.string, vol.Required(CONF_IP_ADDRESS): cv.string,
vol.Optional(CONF_NAME): cv.string vol.Optional(CONF_NAME): cv.string,
}), }),
}, extra=vol.ALLOW_EXTRA) }, extra=vol.ALLOW_EXTRA)

View file

@ -1,10 +1,4 @@
""" """Support for Lupusec System alarm control panels."""
This component provides HA alarm_control_panel support for Lupusec System.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.lupusec/
"""
from datetime import timedelta from datetime import timedelta
from homeassistant.components.alarm_control_panel import AlarmControlPanel from homeassistant.components.alarm_control_panel import AlarmControlPanel

View file

@ -1,9 +1,4 @@
""" """Support for Lupusec Security System binary sensors."""
This component provides HA binary_sensor support for Lupusec Security System.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.lupusec/
"""
import logging import logging
from datetime import timedelta from datetime import timedelta

View file

@ -1,9 +1,4 @@
""" """Support for Lupusec Security System switches."""
This component provides HA switch support for Lupusec Security System.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.lupusec/
"""
import logging import logging
from datetime import timedelta from datetime import timedelta

View file

@ -1,9 +1,4 @@
""" """Component for interacting with a Lutron RadioRA 2 system."""
Component for interacting with a Lutron RadioRA 2 system.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/lutron/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol

View file

@ -1,9 +1,4 @@
""" """Support for Lutron shades."""
Support for Lutron shades.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/cover.lutron/
"""
import logging import logging
from homeassistant.components.cover import ( from homeassistant.components.cover import (

View file

@ -1,9 +1,4 @@
""" """Support for Lutron lights."""
Support for Lutron lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.lutron/
"""
import logging import logging
from homeassistant.components.light import ( from homeassistant.components.light import (

View file

@ -1,9 +1,4 @@
""" """Support for Lutron scenes."""
Support for Lutron scenes.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/scene.lutron/
"""
import logging import logging
from homeassistant.components.lutron import ( from homeassistant.components.lutron import (
@ -30,11 +25,8 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
class LutronScene(LutronDevice, Scene): class LutronScene(LutronDevice, Scene):
"""Representation of a Lutron Scene.""" """Representation of a Lutron Scene."""
def __init__(self, def __init__(
area_name, self, area_name, keypad_name, lutron_device, lutron_led,
keypad_name,
lutron_device,
lutron_led,
controller): controller):
"""Initialize the scene/button.""" """Initialize the scene/button."""
super().__init__(area_name, lutron_device, controller) super().__init__(area_name, lutron_device, controller)
@ -48,6 +40,5 @@ class LutronScene(LutronDevice, Scene):
@property @property
def name(self): def name(self):
"""Return the name of the device.""" """Return the name of the device."""
return "{} {}: {}".format(self._area_name, return "{} {}: {}".format(
self._keypad_name, self._area_name, self._keypad_name, self._lutron_device.name)
self._lutron_device.name)

View file

@ -1,9 +1,4 @@
""" """Support for Lutron switches."""
Support for Lutron switches.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.lutron/
"""
import logging import logging
from homeassistant.components.switch import SwitchDevice from homeassistant.components.switch import SwitchDevice

View file

@ -1,9 +1,4 @@
""" """Component for interacting with a Lutron Caseta system."""
Component for interacting with a Lutron Caseta system.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/lutron_caseta/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol
@ -30,7 +25,7 @@ CONFIG_SCHEMA = vol.Schema({
vol.Required(CONF_HOST): cv.string, vol.Required(CONF_HOST): cv.string,
vol.Required(CONF_KEYFILE): cv.string, vol.Required(CONF_KEYFILE): cv.string,
vol.Required(CONF_CERTFILE): cv.string, vol.Required(CONF_CERTFILE): cv.string,
vol.Required(CONF_CA_CERTS): cv.string vol.Required(CONF_CA_CERTS): cv.string,
}) })
}, extra=vol.ALLOW_EXTRA) }, extra=vol.ALLOW_EXTRA)
@ -47,15 +42,14 @@ async def async_setup(hass, base_config):
keyfile = hass.config.path(config[CONF_KEYFILE]) keyfile = hass.config.path(config[CONF_KEYFILE])
certfile = hass.config.path(config[CONF_CERTFILE]) certfile = hass.config.path(config[CONF_CERTFILE])
ca_certs = hass.config.path(config[CONF_CA_CERTS]) ca_certs = hass.config.path(config[CONF_CA_CERTS])
bridge = Smartbridge.create_tls(hostname=config[CONF_HOST], bridge = Smartbridge.create_tls(
keyfile=keyfile, hostname=config[CONF_HOST], keyfile=keyfile, certfile=certfile,
certfile=certfile,
ca_certs=ca_certs) ca_certs=ca_certs)
hass.data[LUTRON_CASETA_SMARTBRIDGE] = bridge hass.data[LUTRON_CASETA_SMARTBRIDGE] = bridge
await bridge.connect() await bridge.connect()
if not hass.data[LUTRON_CASETA_SMARTBRIDGE].is_connected(): if not hass.data[LUTRON_CASETA_SMARTBRIDGE].is_connected():
_LOGGER.error("Unable to connect to Lutron smartbridge at %s", _LOGGER.error(
config[CONF_HOST]) "Unable to connect to Lutron smartbridge at %s", config[CONF_HOST])
return False return False
_LOGGER.info("Connected to Lutron smartbridge at %s", config[CONF_HOST]) _LOGGER.info("Connected to Lutron smartbridge at %s", config[CONF_HOST])

View file

@ -1,9 +1,4 @@
""" """Support for Lutron Caseta shades."""
Support for Lutron Caseta shades.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/cover.lutron_caseta/
"""
import logging import logging
from homeassistant.components.cover import ( from homeassistant.components.cover import (
@ -17,8 +12,8 @@ _LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['lutron_caseta'] DEPENDENCIES = ['lutron_caseta']
async def async_setup_platform(hass, config, async_add_entities, async def async_setup_platform(
discovery_info=None): hass, config, async_add_entities, discovery_info=None):
"""Set up the Lutron Caseta shades as a cover device.""" """Set up the Lutron Caseta shades as a cover device."""
devs = [] devs = []
bridge = hass.data[LUTRON_CASETA_SMARTBRIDGE] bridge = hass.data[LUTRON_CASETA_SMARTBRIDGE]

View file

@ -1,9 +1,4 @@
""" """Support for Lutron Caseta lights."""
Support for Lutron Caseta lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.lutron_caseta/
"""
import logging import logging
from homeassistant.components.light import ( from homeassistant.components.light import (
@ -18,8 +13,8 @@ _LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['lutron_caseta'] DEPENDENCIES = ['lutron_caseta']
async def async_setup_platform(hass, config, async_add_entities, async def async_setup_platform(
discovery_info=None): hass, config, async_add_entities, discovery_info=None):
"""Set up the Lutron Caseta lights.""" """Set up the Lutron Caseta lights."""
devs = [] devs = []
bridge = hass.data[LUTRON_CASETA_SMARTBRIDGE] bridge = hass.data[LUTRON_CASETA_SMARTBRIDGE]

View file

@ -1,9 +1,4 @@
""" """Support for Lutron Caseta scenes."""
Support for Lutron Caseta scenes.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/scene.lutron_caseta/
"""
import logging import logging
from homeassistant.components.lutron_caseta import LUTRON_CASETA_SMARTBRIDGE from homeassistant.components.lutron_caseta import LUTRON_CASETA_SMARTBRIDGE
@ -14,8 +9,8 @@ _LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['lutron_caseta'] DEPENDENCIES = ['lutron_caseta']
async def async_setup_platform(hass, config, async_add_entities, async def async_setup_platform(
discovery_info=None): hass, config, async_add_entities, discovery_info=None):
"""Set up the Lutron Caseta lights.""" """Set up the Lutron Caseta lights."""
devs = [] devs = []
bridge = hass.data[LUTRON_CASETA_SMARTBRIDGE] bridge = hass.data[LUTRON_CASETA_SMARTBRIDGE]
@ -32,8 +27,8 @@ class LutronCasetaScene(Scene):
def __init__(self, scene, bridge): def __init__(self, scene, bridge):
"""Initialize the Lutron Caseta scene.""" """Initialize the Lutron Caseta scene."""
self._scene_name = scene["name"] self._scene_name = scene['name']
self._scene_id = scene["scene_id"] self._scene_id = scene['scene_id']
self._bridge = bridge self._bridge = bridge
@property @property

View file

@ -1,9 +1,4 @@
""" """Support for Lutron Caseta switches."""
Support for Lutron Caseta switches.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sitch.lutron_caseta/
"""
import logging import logging
from homeassistant.components.lutron_caseta import ( from homeassistant.components.lutron_caseta import (
@ -15,8 +10,8 @@ _LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['lutron_caseta'] DEPENDENCIES = ['lutron_caseta']
async def async_setup_platform(hass, config, async_add_entities, async def async_setup_platform(
discovery_info=None): hass, config, async_add_entities, discovery_info=None):
"""Set up Lutron switch.""" """Set up Lutron switch."""
devs = [] devs = []
bridge = hass.data[LUTRON_CASETA_SMARTBRIDGE] bridge = hass.data[LUTRON_CASETA_SMARTBRIDGE]

View file

@ -1,9 +1,4 @@
""" """Support for Voice mailboxes."""
Provides functionality for mailboxes.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/mailbox/
"""
import asyncio import asyncio
from contextlib import suppress from contextlib import suppress
from datetime import timedelta from datetime import timedelta

View file

@ -1,9 +1,4 @@
""" """Support for the Asterisk CDR interface."""
Asterisk CDR interface.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/mailbox.asterisk_cdr/
"""
import logging import logging
import hashlib import hashlib
import datetime import datetime
@ -14,9 +9,11 @@ from homeassistant.components.asterisk_mbox import DOMAIN as ASTERISK_DOMAIN
from homeassistant.components.mailbox import Mailbox from homeassistant.components.mailbox import Mailbox
from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.dispatcher import async_dispatcher_connect
DEPENDENCIES = ['asterisk_mbox']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
MAILBOX_NAME = "asterisk_cdr"
DEPENDENCIES = ['asterisk_mbox']
MAILBOX_NAME = 'asterisk_cdr'
async def async_get_handler(hass, config, discovery_info=None): async def async_get_handler(hass, config, discovery_info=None):

View file

@ -1,9 +1,4 @@
""" """Support for a demo mailbox."""
Asterisk Voicemail interface.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/mailbox.asteriskvm/
"""
from hashlib import sha1 from hashlib import sha1
import logging import logging
import os import os
@ -14,7 +9,7 @@ from homeassistant.util import dt
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
MAILBOX_NAME = "DemoMailbox" MAILBOX_NAME = 'DemoMailbox'
async def async_get_handler(hass, config, discovery_info=None): async def async_get_handler(hass, config, discovery_info=None):

View file

@ -1,9 +1,4 @@
""" """Support for Mailgun."""
Support for Mailgun.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/mailgun/
"""
import hashlib import hashlib
import hmac import hmac
import json import json
@ -15,12 +10,15 @@ import homeassistant.helpers.config_validation as cv
from homeassistant.const import CONF_API_KEY, CONF_DOMAIN, CONF_WEBHOOK_ID from homeassistant.const import CONF_API_KEY, CONF_DOMAIN, CONF_WEBHOOK_ID
from homeassistant.helpers import config_entry_flow from homeassistant.helpers import config_entry_flow
DOMAIN = 'mailgun'
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['webhook']
MESSAGE_RECEIVED = '{}_message_received'.format(DOMAIN)
CONF_SANDBOX = 'sandbox' CONF_SANDBOX = 'sandbox'
DEFAULT_SANDBOX = False DEFAULT_SANDBOX = False
DEPENDENCIES = ['webhook']
DOMAIN = 'mailgun'
MESSAGE_RECEIVED = '{}_message_received'.format(DOMAIN)
CONFIG_SCHEMA = vol.Schema({ CONFIG_SCHEMA = vol.Schema({
vol.Optional(DOMAIN): vol.Schema({ vol.Optional(DOMAIN): vol.Schema({

View file

@ -1,9 +1,4 @@
""" """Support for the Mailgun mail notifications."""
Support for the Mailgun mail notification service.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.mailgun/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol
@ -16,10 +11,11 @@ from homeassistant.components.notify import (
from homeassistant.const import ( from homeassistant.const import (
CONF_API_KEY, CONF_DOMAIN, CONF_RECIPIENT, CONF_SENDER) CONF_API_KEY, CONF_DOMAIN, CONF_RECIPIENT, CONF_SENDER)
REQUIREMENTS = ['pymailgunner==1.4']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['mailgun'] DEPENDENCIES = ['mailgun']
REQUIREMENTS = ['pymailgunner==1.4']
# Images to attach to notification # Images to attach to notification
ATTR_IMAGES = 'images' ATTR_IMAGES = 'images'
@ -30,7 +26,7 @@ DEFAULT_SANDBOX = False
# pylint: disable=no-value-for-parameter # pylint: disable=no-value-for-parameter
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_RECIPIENT): vol.Email(), vol.Required(CONF_RECIPIENT): vol.Email(),
vol.Optional(CONF_SENDER): vol.Email() vol.Optional(CONF_SENDER): vol.Email(),
}) })

View file

@ -1,9 +1,4 @@
""" """Support for showing device locations."""
Provides a map panel for showing device locations.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/map/
"""
DOMAIN = 'map' DOMAIN = 'map'

View file

@ -1,9 +1,4 @@
""" """The matrix bot component."""
The matrix bot component.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/matrix/
"""
import logging import logging
import os import os
from functools import partial from functools import partial
@ -41,8 +36,8 @@ COMMAND_SCHEMA = vol.All(
vol.Exclusive(CONF_WORD, 'trigger'): cv.string, vol.Exclusive(CONF_WORD, 'trigger'): cv.string,
vol.Exclusive(CONF_EXPRESSION, 'trigger'): cv.is_regex, vol.Exclusive(CONF_EXPRESSION, 'trigger'): cv.is_regex,
vol.Required(CONF_NAME): cv.string, vol.Required(CONF_NAME): cv.string,
vol.Optional(CONF_ROOMS, default=[]): vol.All(cv.ensure_list, vol.Optional(CONF_ROOMS, default=[]):
[cv.string]), vol.All(cv.ensure_list, [cv.string]),
}), }),
# Make sure it's either a word or an expression command # Make sure it's either a word or an expression command
cv.has_at_least_one_key(CONF_WORD, CONF_EXPRESSION) cv.has_at_least_one_key(CONF_WORD, CONF_EXPRESSION)
@ -54,8 +49,8 @@ CONFIG_SCHEMA = vol.Schema({
vol.Optional(CONF_VERIFY_SSL, default=True): cv.boolean, vol.Optional(CONF_VERIFY_SSL, default=True): cv.boolean,
vol.Required(CONF_USERNAME): cv.matches_regex("@[^:]*:.*"), vol.Required(CONF_USERNAME): cv.matches_regex("@[^:]*:.*"),
vol.Required(CONF_PASSWORD): cv.string, vol.Required(CONF_PASSWORD): cv.string,
vol.Optional(CONF_ROOMS, default=[]): vol.All(cv.ensure_list, vol.Optional(CONF_ROOMS, default=[]):
[cv.string]), vol.All(cv.ensure_list, [cv.string]),
vol.Optional(CONF_COMMANDS, default=[]): [COMMAND_SCHEMA] vol.Optional(CONF_COMMANDS, default=[]): [COMMAND_SCHEMA]
}) })
}, extra=vol.ALLOW_EXTRA) }, extra=vol.ALLOW_EXTRA)
@ -76,13 +71,9 @@ def setup(hass, config):
try: try:
bot = MatrixBot( bot = MatrixBot(
hass, hass, os.path.join(hass.config.path(), SESSION_FILE),
os.path.join(hass.config.path(), SESSION_FILE), config[CONF_HOMESERVER], config[CONF_VERIFY_SSL],
config[CONF_HOMESERVER], config[CONF_USERNAME], config[CONF_PASSWORD], config[CONF_ROOMS],
config[CONF_VERIFY_SSL],
config[CONF_USERNAME],
config[CONF_PASSWORD],
config[CONF_ROOMS],
config[CONF_COMMANDS]) config[CONF_COMMANDS])
hass.data[DOMAIN] = bot hass.data[DOMAIN] = bot
except MatrixRequestError as exception: except MatrixRequestError as exception:

View file

@ -1,9 +1,4 @@
""" """Support for Matrix notifications."""
Matrix notification service.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.matrix/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol

View file

@ -1,9 +1,4 @@
""" """Support for the MAX! Cube LAN Gateway."""
Platform for the MAX! Cube LAN Gateway.
For more details about this component, please refer to the documentation
https://home-assistant.io/components/maxcube/
"""
import logging import logging
import time import time
from socket import timeout from socket import timeout
@ -38,7 +33,7 @@ CONFIG_GATEWAY = vol.Schema({
CONFIG_SCHEMA = vol.Schema({ CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.Schema({ DOMAIN: vol.Schema({
vol.Required(CONF_GATEWAYS, default={}): vol.Required(CONF_GATEWAYS, default={}):
vol.All(cv.ensure_list, [CONFIG_GATEWAY]) vol.All(cv.ensure_list, [CONFIG_GATEWAY]),
}), }),
}, extra=vol.ALLOW_EXTRA) }, extra=vol.ALLOW_EXTRA)

View file

@ -1,9 +1,4 @@
""" """Support for MAX! binary sensors via MAX! Cube."""
Support for MAX! Window Shutter via MAX! Cube.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/maxcube/
"""
import logging import logging
from homeassistant.components.binary_sensor import BinarySensorDevice from homeassistant.components.binary_sensor import BinarySensorDevice

View file

@ -1,9 +1,4 @@
""" """Support for MAX! Thermostats via MAX! Cube."""
Support for MAX! Thermostats via MAX! Cube.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/maxcube/
"""
import socket import socket
import logging import logging

View file

@ -1,9 +1,4 @@
""" """Decorator service for the media_player.play_media service."""
Decorator service for the media_player.play_media service.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/media_extractor/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol

View file

@ -1,9 +1,4 @@
""" """Support for Melissa climate."""
Support for Melissa climate.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/melissa/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol
@ -16,7 +11,7 @@ REQUIREMENTS = ["py-melissa-climate==2.0.0"]
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
DOMAIN = "melissa" DOMAIN = 'melissa'
DATA_MELISSA = 'MELISSA' DATA_MELISSA = 'MELISSA'

View file

@ -1,9 +1,4 @@
""" """Support for Microsoft face recognition."""
Support for Microsoft face recognition.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/microsoft_face/
"""
import asyncio import asyncio
import json import json
import logging import logging
@ -45,7 +40,7 @@ SERVICE_TRAIN_GROUP = 'train_group'
CONFIG_SCHEMA = vol.Schema({ CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.Schema({ DOMAIN: vol.Schema({
vol.Required(CONF_API_KEY): cv.string, vol.Required(CONF_API_KEY): cv.string,
vol.Optional(CONF_AZURE_REGION, default="westus"): cv.string, vol.Optional(CONF_AZURE_REGION, default='westus'): cv.string,
vol.Optional(CONF_TIMEOUT, default=DEFAULT_TIMEOUT): cv.positive_int, vol.Optional(CONF_TIMEOUT, default=DEFAULT_TIMEOUT): cv.positive_int,
}), }),
}, extra=vol.ALLOW_EXTRA) }, extra=vol.ALLOW_EXTRA)

View file

@ -1,9 +1,4 @@
""" """Support for CM15A/CM19A X10 Controller using mochad daemon."""
Support for CM15A/CM19A X10 Controller using mochad daemon.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/mochad/
"""
import logging import logging
import threading import threading

View file

@ -1,10 +1,4 @@
""" """Support for X10 dimmer over Mochad."""
Contains functionality to use a X10 dimmer over Mochad.
For more details about this platform, please refer to the documentation at
https://home.assistant.io/components/light.mochad/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol
@ -16,11 +10,11 @@ from homeassistant.const import (
CONF_NAME, CONF_PLATFORM, CONF_DEVICES, CONF_ADDRESS) CONF_NAME, CONF_PLATFORM, CONF_DEVICES, CONF_ADDRESS)
from homeassistant.helpers import config_validation as cv from homeassistant.helpers import config_validation as cv
DEPENDENCIES = ['mochad']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
CONF_BRIGHTNESS_LEVELS = 'brightness_levels' DEPENDENCIES = ['mochad']
CONF_BRIGHTNESS_LEVELS = 'brightness_levels'
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_PLATFORM): mochad.DOMAIN, vol.Required(CONF_PLATFORM): mochad.DOMAIN,
@ -51,11 +45,11 @@ class MochadLight(Light):
self._controller = ctrl self._controller = ctrl
self._address = dev[CONF_ADDRESS] self._address = dev[CONF_ADDRESS]
self._name = dev.get(CONF_NAME, self._name = dev.get(
'x10_light_dev_{}'.format(self._address)) CONF_NAME, 'x10_light_dev_{}'.format(self._address))
self._comm_type = dev.get(mochad.CONF_COMM_TYPE, 'pl') self._comm_type = dev.get(mochad.CONF_COMM_TYPE, 'pl')
self.light = device.Device(ctrl, self._address, self.light = device.Device(
comm_type=self._comm_type) ctrl, self._address, comm_type=self._comm_type)
self._brightness = 0 self._brightness = 0
self._state = self._get_device_status() self._state = self._get_device_status()
self._brightness_levels = dev.get(CONF_BRIGHTNESS_LEVELS) - 1 self._brightness_levels = dev.get(CONF_BRIGHTNESS_LEVELS) - 1

View file

@ -1,10 +1,4 @@
""" """Support for X10 switch over Mochad."""
Contains functionality to use a X10 switch over Mochad.
For more details about this platform, please refer to the documentation at
https://home.assistant.io/components/switch.mochad
"""
import logging import logging
import voluptuous as vol import voluptuous as vol
@ -15,9 +9,10 @@ from homeassistant.const import (CONF_NAME, CONF_DEVICES,
CONF_PLATFORM, CONF_ADDRESS) CONF_PLATFORM, CONF_ADDRESS)
from homeassistant.helpers import config_validation as cv from homeassistant.helpers import config_validation as cv
DEPENDENCIES = ['mochad']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['mochad']
PLATFORM_SCHEMA = vol.Schema({ PLATFORM_SCHEMA = vol.Schema({
vol.Required(CONF_PLATFORM): mochad.DOMAIN, vol.Required(CONF_PLATFORM): mochad.DOMAIN,
@ -48,8 +43,8 @@ class MochadSwitch(SwitchDevice):
self._address = dev[CONF_ADDRESS] self._address = dev[CONF_ADDRESS]
self._name = dev.get(CONF_NAME, 'x10_switch_dev_%s' % self._address) self._name = dev.get(CONF_NAME, 'x10_switch_dev_%s' % self._address)
self._comm_type = dev.get(mochad.CONF_COMM_TYPE, 'pl') self._comm_type = dev.get(mochad.CONF_COMM_TYPE, 'pl')
self.switch = device.Device(ctrl, self._address, self.switch = device.Device(
comm_type=self._comm_type) ctrl, self._address, comm_type=self._comm_type)
# Init with false to avoid locking HA for long on CM19A (goes from rf # Init with false to avoid locking HA for long on CM19A (goes from rf
# to pl via TM751, but not other way around) # to pl via TM751, but not other way around)
if self._comm_type == 'pl': if self._comm_type == 'pl':

View file

@ -1,9 +1,4 @@
""" """Support for Modbus."""
Support for Modbus.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/modbus/
"""
import logging import logging
import threading import threading

View file

@ -1,9 +1,4 @@
""" """Support for Modbus Coil sensors."""
Support for Modbus Coil sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.modbus/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol
@ -25,7 +20,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_HUB, default=DEFAULT_HUB): cv.string, vol.Optional(CONF_HUB, default=DEFAULT_HUB): cv.string,
vol.Required(CONF_COIL): cv.positive_int, vol.Required(CONF_COIL): cv.positive_int,
vol.Required(CONF_NAME): cv.string, vol.Required(CONF_NAME): cv.string,
vol.Optional(CONF_SLAVE): cv.positive_int vol.Optional(CONF_SLAVE): cv.positive_int,
}] }]
}) })
@ -36,9 +31,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
for coil in config.get(CONF_COILS): for coil in config.get(CONF_COILS):
hub = hass.data[MODBUS_DOMAIN][coil.get(CONF_HUB)] hub = hass.data[MODBUS_DOMAIN][coil.get(CONF_HUB)]
sensors.append(ModbusCoilSensor( sensors.append(ModbusCoilSensor(
hub, hub, coil.get(CONF_NAME), coil.get(CONF_SLAVE),
coil.get(CONF_NAME),
coil.get(CONF_SLAVE),
coil.get(CONF_COIL))) coil.get(CONF_COIL)))
add_entities(sensors) add_entities(sensors)
@ -70,5 +63,5 @@ class ModbusCoilSensor(BinarySensorDevice):
try: try:
self._value = result.bits[0] self._value = result.bits[0]
except AttributeError: except AttributeError:
_LOGGER.error('No response from hub %s, slave %s, coil %s', _LOGGER.error("No response from hub %s, slave %s, coil %s",
self._hub.name, self._slave, self._coil) self._hub.name, self._slave, self._coil)

View file

@ -1,13 +1,4 @@
""" """Support for Generic Modbus Thermostats."""
Platform for a Generic Modbus Thermostat.
This uses a setpoint and process
value within the controller, so both the current temperature register and the
target temperature register need to be configured.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/climate.modbus/
"""
import logging import logging
import struct import struct
@ -21,6 +12,8 @@ from homeassistant.components.modbus import (
CONF_HUB, DEFAULT_HUB, DOMAIN as MODBUS_DOMAIN) CONF_HUB, DEFAULT_HUB, DOMAIN as MODBUS_DOMAIN)
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['modbus'] DEPENDENCIES = ['modbus']
# Parameters not defined by homeassistant.const # Parameters not defined by homeassistant.const
@ -46,8 +39,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_PRECISION, default=1): cv.positive_int vol.Optional(CONF_PRECISION, default=1): cv.positive_int
}) })
_LOGGER = logging.getLogger(__name__)
SUPPORT_FLAGS = SUPPORT_TARGET_TEMPERATURE SUPPORT_FLAGS = SUPPORT_TARGET_TEMPERATURE
@ -63,8 +54,8 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
hub_name = config.get(CONF_HUB) hub_name = config.get(CONF_HUB)
hub = hass.data[MODBUS_DOMAIN][hub_name] hub = hass.data[MODBUS_DOMAIN][hub_name]
add_entities([ModbusThermostat(hub, name, modbus_slave, add_entities([ModbusThermostat(
target_temp_register, current_temp_register, hub, name, modbus_slave, target_temp_register, current_temp_register,
data_type, count, precision)], True) data_type, count, precision)], True)

Some files were not shown because too many files have changed in this diff Show more