mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 00:37:13 +00:00
Fix imports (using isort)
This commit is contained in:
parent
233a2a2878
commit
e80309c03c
@ -1,18 +1,18 @@
|
|||||||
""" Starts home assistant. """
|
""" Starts home assistant. """
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
from multiprocessing import Process
|
import argparse
|
||||||
|
import os
|
||||||
import signal
|
import signal
|
||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
import os
|
|
||||||
import argparse
|
|
||||||
import time
|
import time
|
||||||
|
from multiprocessing import Process
|
||||||
|
|
||||||
from homeassistant import bootstrap
|
|
||||||
import homeassistant.config as config_util
|
import homeassistant.config as config_util
|
||||||
from homeassistant.const import (__version__, EVENT_HOMEASSISTANT_START,
|
from homeassistant import bootstrap
|
||||||
RESTART_EXIT_CODE)
|
from homeassistant.const import (
|
||||||
|
EVENT_HOMEASSISTANT_START, RESTART_EXIT_CODE, __version__)
|
||||||
|
|
||||||
|
|
||||||
def validate_python():
|
def validate_python():
|
||||||
|
@ -9,27 +9,27 @@ After bootstrapping you can add your own components or
|
|||||||
start by calling homeassistant.start_home_assistant(bus)
|
start by calling homeassistant.start_home_assistant(bus)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from collections import defaultdict
|
|
||||||
import logging
|
import logging
|
||||||
import logging.handlers
|
import logging.handlers
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
|
from collections import defaultdict
|
||||||
|
|
||||||
import homeassistant.core as core
|
|
||||||
import homeassistant.util.dt as date_util
|
|
||||||
import homeassistant.util.package as pkg_util
|
|
||||||
import homeassistant.util.location as loc_util
|
|
||||||
import homeassistant.config as config_util
|
|
||||||
import homeassistant.loader as loader
|
|
||||||
import homeassistant.components as core_components
|
import homeassistant.components as core_components
|
||||||
import homeassistant.components.group as group
|
import homeassistant.components.group as group
|
||||||
|
import homeassistant.config as config_util
|
||||||
|
import homeassistant.core as core
|
||||||
|
import homeassistant.loader as loader
|
||||||
|
import homeassistant.util.dt as date_util
|
||||||
|
import homeassistant.util.location as loc_util
|
||||||
|
import homeassistant.util.package as pkg_util
|
||||||
|
from homeassistant.const import (
|
||||||
|
CONF_CUSTOMIZE, CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME,
|
||||||
|
CONF_TEMPERATURE_UNIT, CONF_TIME_ZONE, EVENT_COMPONENT_LOADED,
|
||||||
|
TEMP_CELCIUS, TEMP_FAHRENHEIT, __version__)
|
||||||
from homeassistant.helpers import event_decorators, service
|
from homeassistant.helpers import event_decorators, service
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
from homeassistant.const import (
|
|
||||||
__version__, EVENT_COMPONENT_LOADED, CONF_LATITUDE, CONF_LONGITUDE,
|
|
||||||
CONF_TEMPERATURE_UNIT, CONF_NAME, CONF_TIME_ZONE, CONF_CUSTOMIZE,
|
|
||||||
TEMP_CELCIUS, TEMP_FAHRENHEIT)
|
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -9,11 +9,9 @@ https://home-assistant.io/components/alarm_control_panel.alarmdotcom/
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
import homeassistant.components.alarm_control_panel as alarm
|
import homeassistant.components.alarm_control_panel as alarm
|
||||||
from homeassistant.const import CONF_USERNAME, CONF_PASSWORD
|
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
STATE_UNKNOWN,
|
CONF_PASSWORD, CONF_USERNAME, STATE_ALARM_ARMED_AWAY,
|
||||||
STATE_ALARM_DISARMED, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_AWAY)
|
STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED, STATE_UNKNOWN)
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -6,15 +6,15 @@ Support for manual alarms.
|
|||||||
For more details about this platform, please refer to the documentation at
|
For more details about this platform, please refer to the documentation at
|
||||||
https://home-assistant.io/components/alarm_control_panel.manual/
|
https://home-assistant.io/components/alarm_control_panel.manual/
|
||||||
"""
|
"""
|
||||||
import logging
|
|
||||||
import datetime
|
import datetime
|
||||||
import homeassistant.components.alarm_control_panel as alarm
|
import logging
|
||||||
from homeassistant.helpers.event import track_point_in_time
|
|
||||||
import homeassistant.util.dt as dt_util
|
|
||||||
|
|
||||||
|
import homeassistant.components.alarm_control_panel as alarm
|
||||||
|
import homeassistant.util.dt as dt_util
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
STATE_ALARM_DISARMED, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_AWAY,
|
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED,
|
||||||
STATE_ALARM_PENDING, STATE_ALARM_TRIGGERED)
|
STATE_ALARM_PENDING, STATE_ALARM_TRIGGERED)
|
||||||
|
from homeassistant.helpers.event import track_point_in_time
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -7,11 +7,11 @@ For more details about this platform, please refer to the documentation at
|
|||||||
https://home-assistant.io/components/alarm_control_panel.mqtt/
|
https://home-assistant.io/components/alarm_control_panel.mqtt/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
import homeassistant.components.mqtt as mqtt
|
|
||||||
import homeassistant.components.alarm_control_panel as alarm
|
|
||||||
|
|
||||||
|
import homeassistant.components.alarm_control_panel as alarm
|
||||||
|
import homeassistant.components.mqtt as mqtt
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
STATE_ALARM_DISARMED, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_AWAY,
|
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED,
|
||||||
STATE_ALARM_PENDING, STATE_ALARM_TRIGGERED, STATE_UNKNOWN)
|
STATE_ALARM_PENDING, STATE_ALARM_TRIGGERED, STATE_UNKNOWN)
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
@ -7,12 +7,13 @@ For more details about this platform, please refer to the documentation at
|
|||||||
https://home-assistant.io/components/alarm_control_panel.nx584/
|
https://home-assistant.io/components/alarm_control_panel.nx584/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from homeassistant.const import (STATE_UNKNOWN, STATE_ALARM_DISARMED,
|
|
||||||
STATE_ALARM_ARMED_HOME,
|
|
||||||
STATE_ALARM_ARMED_AWAY)
|
|
||||||
import homeassistant.components.alarm_control_panel as alarm
|
import homeassistant.components.alarm_control_panel as alarm
|
||||||
|
from homeassistant.const import (
|
||||||
|
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED,
|
||||||
|
STATE_UNKNOWN)
|
||||||
|
|
||||||
REQUIREMENTS = ['pynx584==0.2']
|
REQUIREMENTS = ['pynx584==0.2']
|
||||||
|
|
||||||
|
@ -8,12 +8,11 @@ https://home-assistant.io/components/verisure/
|
|||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import homeassistant.components.verisure as verisure
|
|
||||||
import homeassistant.components.alarm_control_panel as alarm
|
import homeassistant.components.alarm_control_panel as alarm
|
||||||
|
import homeassistant.components.verisure as verisure
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
STATE_UNKNOWN,
|
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED,
|
||||||
STATE_ALARM_DISARMED, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_AWAY)
|
STATE_UNKNOWN)
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -10,8 +10,8 @@ import enum
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.const import HTTP_OK, HTTP_UNPROCESSABLE_ENTITY
|
from homeassistant.const import HTTP_OK, HTTP_UNPROCESSABLE_ENTITY
|
||||||
from homeassistant.util import template
|
|
||||||
from homeassistant.helpers.service import call_from_config
|
from homeassistant.helpers.service import call_from_config
|
||||||
|
from homeassistant.util import template
|
||||||
|
|
||||||
DOMAIN = 'alexa'
|
DOMAIN = 'alexa'
|
||||||
DEPENDENCIES = ['http']
|
DEPENDENCIES = ['http']
|
||||||
|
@ -6,26 +6,24 @@ Provides a Rest API for Home Assistant.
|
|||||||
For more details about the RESTful API, please refer to the documentation at
|
For more details about the RESTful API, please refer to the documentation at
|
||||||
https://home-assistant.io/developers/api/
|
https://home-assistant.io/developers/api/
|
||||||
"""
|
"""
|
||||||
import re
|
|
||||||
import logging
|
|
||||||
import threading
|
|
||||||
import json
|
import json
|
||||||
|
import logging
|
||||||
|
import re
|
||||||
|
import threading
|
||||||
|
|
||||||
import homeassistant.core as ha
|
import homeassistant.core as ha
|
||||||
from homeassistant.exceptions import TemplateError
|
|
||||||
from homeassistant.helpers.state import TrackStates
|
|
||||||
import homeassistant.remote as rem
|
import homeassistant.remote as rem
|
||||||
from homeassistant.util import template
|
|
||||||
from homeassistant.bootstrap import ERROR_LOG_FILENAME
|
from homeassistant.bootstrap import ERROR_LOG_FILENAME
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
URL_API, URL_API_STATES, URL_API_EVENTS, URL_API_SERVICES, URL_API_STREAM,
|
CONTENT_TYPE_TEXT_PLAIN, EVENT_HOMEASSISTANT_STOP, EVENT_TIME_CHANGED,
|
||||||
URL_API_EVENT_FORWARD, URL_API_STATES_ENTITY, URL_API_COMPONENTS,
|
HTTP_BAD_REQUEST, HTTP_CREATED, HTTP_HEADER_CONTENT_TYPE, HTTP_NOT_FOUND,
|
||||||
URL_API_CONFIG, URL_API_ERROR_LOG, URL_API_LOG_OUT,
|
HTTP_OK, HTTP_UNPROCESSABLE_ENTITY, MATCH_ALL, URL_API, URL_API_COMPONENTS,
|
||||||
URL_API_TEMPLATE, EVENT_TIME_CHANGED, EVENT_HOMEASSISTANT_STOP, MATCH_ALL,
|
URL_API_CONFIG, URL_API_ERROR_LOG, URL_API_EVENT_FORWARD, URL_API_EVENTS,
|
||||||
HTTP_OK, HTTP_CREATED, HTTP_BAD_REQUEST, HTTP_NOT_FOUND,
|
URL_API_LOG_OUT, URL_API_SERVICES, URL_API_STATES, URL_API_STATES_ENTITY,
|
||||||
HTTP_UNPROCESSABLE_ENTITY, HTTP_HEADER_CONTENT_TYPE,
|
URL_API_STREAM, URL_API_TEMPLATE)
|
||||||
CONTENT_TYPE_TEXT_PLAIN)
|
from homeassistant.exceptions import TemplateError
|
||||||
|
from homeassistant.helpers.state import TrackStates
|
||||||
|
from homeassistant.util import template
|
||||||
|
|
||||||
DOMAIN = 'api'
|
DOMAIN = 'api'
|
||||||
DEPENDENCIES = ['http']
|
DEPENDENCIES = ['http']
|
||||||
|
@ -9,9 +9,9 @@ https://home-assistant.io/components/arduino/
|
|||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from homeassistant.const import (
|
||||||
|
EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP)
|
||||||
from homeassistant.helpers import validate_config
|
from homeassistant.helpers import validate_config
|
||||||
from homeassistant.const import (EVENT_HOMEASSISTANT_START,
|
|
||||||
EVENT_HOMEASSISTANT_STOP)
|
|
||||||
|
|
||||||
DOMAIN = "arduino"
|
DOMAIN = "arduino"
|
||||||
REQUIREMENTS = ['PyMata==2.07a']
|
REQUIREMENTS = ['PyMata==2.07a']
|
||||||
|
@ -6,14 +6,13 @@ Offers numeric state listening automation rules.
|
|||||||
For more details about this automation rule, please refer to the documentation
|
For more details about this automation rule, please refer to the documentation
|
||||||
at https://home-assistant.io/components/automation/#numeric-state-trigger
|
at https://home-assistant.io/components/automation/#numeric-state-trigger
|
||||||
"""
|
"""
|
||||||
from functools import partial
|
|
||||||
import logging
|
import logging
|
||||||
|
from functools import partial
|
||||||
|
|
||||||
from homeassistant.const import CONF_VALUE_TEMPLATE
|
from homeassistant.const import CONF_VALUE_TEMPLATE
|
||||||
from homeassistant.helpers.event import track_state_change
|
from homeassistant.helpers.event import track_state_change
|
||||||
from homeassistant.util import template
|
from homeassistant.util import template
|
||||||
|
|
||||||
|
|
||||||
CONF_ENTITY_ID = "entity_id"
|
CONF_ENTITY_ID = "entity_id"
|
||||||
CONF_BELOW = "below"
|
CONF_BELOW = "below"
|
||||||
CONF_ABOVE = "above"
|
CONF_ABOVE = "above"
|
||||||
|
@ -8,9 +8,8 @@ at https://home-assistant.io/components/automation/#state-trigger
|
|||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.helpers.event import track_state_change
|
|
||||||
from homeassistant.const import MATCH_ALL
|
from homeassistant.const import MATCH_ALL
|
||||||
|
from homeassistant.helpers.event import track_state_change
|
||||||
|
|
||||||
CONF_ENTITY_ID = "entity_id"
|
CONF_ENTITY_ID = "entity_id"
|
||||||
CONF_FROM = "from"
|
CONF_FROM = "from"
|
||||||
|
@ -9,9 +9,9 @@ at https://home-assistant.io/components/automation/#sun-trigger
|
|||||||
import logging
|
import logging
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
|
import homeassistant.util.dt as dt_util
|
||||||
from homeassistant.components import sun
|
from homeassistant.components import sun
|
||||||
from homeassistant.helpers.event import track_sunrise, track_sunset
|
from homeassistant.helpers.event import track_sunrise, track_sunset
|
||||||
import homeassistant.util.dt as dt_util
|
|
||||||
|
|
||||||
DEPENDENCIES = ['sun']
|
DEPENDENCIES = ['sun']
|
||||||
|
|
||||||
|
@ -9,10 +9,9 @@ at https://home-assistant.io/components/automation/#zone-trigger
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.components import zone
|
from homeassistant.components import zone
|
||||||
from homeassistant.helpers.event import track_state_change
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_GPS_ACCURACY, ATTR_LATITUDE, ATTR_LONGITUDE, MATCH_ALL)
|
ATTR_GPS_ACCURACY, ATTR_LATITUDE, ATTR_LONGITUDE, MATCH_ALL)
|
||||||
|
from homeassistant.helpers.event import track_state_change
|
||||||
|
|
||||||
CONF_ENTITY_ID = "entity_id"
|
CONF_ENTITY_ID = "entity_id"
|
||||||
CONF_ZONE = "zone"
|
CONF_ZONE = "zone"
|
||||||
|
@ -6,8 +6,8 @@ Provides a binary sensor to track online status of a UPS.
|
|||||||
For more details about this platform, please refer to the documentation at
|
For more details about this platform, please refer to the documentation at
|
||||||
https://home-assistant.io/components/binary_sensor.apcupsd/
|
https://home-assistant.io/components/binary_sensor.apcupsd/
|
||||||
"""
|
"""
|
||||||
from homeassistant.components.binary_sensor import BinarySensorDevice
|
|
||||||
from homeassistant.components import apcupsd
|
from homeassistant.components import apcupsd
|
||||||
|
from homeassistant.components.binary_sensor import BinarySensorDevice
|
||||||
|
|
||||||
DEPENDENCIES = [apcupsd.DOMAIN]
|
DEPENDENCIES = [apcupsd.DOMAIN]
|
||||||
DEFAULT_NAME = "UPS Online Status"
|
DEFAULT_NAME = "UPS Online Status"
|
||||||
|
@ -6,13 +6,13 @@ The arest sensor will consume an exposed aREST API of a device.
|
|||||||
For more details about this platform, please refer to the documentation at
|
For more details about this platform, please refer to the documentation at
|
||||||
https://home-assistant.io/components/binary_sensor.arest/
|
https://home-assistant.io/components/binary_sensor.arest/
|
||||||
"""
|
"""
|
||||||
from datetime import timedelta
|
|
||||||
import logging
|
import logging
|
||||||
|
from datetime import timedelta
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from homeassistant.util import Throttle
|
|
||||||
from homeassistant.components.binary_sensor import BinarySensorDevice
|
from homeassistant.components.binary_sensor import BinarySensorDevice
|
||||||
|
from homeassistant.util import Throttle
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -10,9 +10,9 @@ https://home-assistant.io/components/binary_sensor.command/
|
|||||||
import logging
|
import logging
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
from homeassistant.const import CONF_VALUE_TEMPLATE
|
|
||||||
from homeassistant.components.binary_sensor import BinarySensorDevice
|
from homeassistant.components.binary_sensor import BinarySensorDevice
|
||||||
from homeassistant.components.sensor.command_sensor import CommandSensorData
|
from homeassistant.components.sensor.command_sensor import CommandSensorData
|
||||||
|
from homeassistant.const import CONF_VALUE_TEMPLATE
|
||||||
from homeassistant.util import template
|
from homeassistant.util import template
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
@ -8,10 +8,10 @@ https://home-assistant.io/components/binary_sensor.mqtt/
|
|||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.const import CONF_VALUE_TEMPLATE
|
|
||||||
from homeassistant.components.binary_sensor import BinarySensorDevice
|
|
||||||
from homeassistant.util import template
|
|
||||||
import homeassistant.components.mqtt as mqtt
|
import homeassistant.components.mqtt as mqtt
|
||||||
|
from homeassistant.components.binary_sensor import BinarySensorDevice
|
||||||
|
from homeassistant.const import CONF_VALUE_TEMPLATE
|
||||||
|
from homeassistant.util import template
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -8,10 +8,10 @@ https://home-assistant.io/components/binary_sensor.nest/
|
|||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
import socket
|
import socket
|
||||||
import homeassistant.components.nest as nest
|
|
||||||
|
|
||||||
from homeassistant.components.sensor.nest import NestSensor
|
import homeassistant.components.nest as nest
|
||||||
from homeassistant.components.binary_sensor import BinarySensorDevice
|
from homeassistant.components.binary_sensor import BinarySensorDevice
|
||||||
|
from homeassistant.components.sensor.nest import NestSensor
|
||||||
|
|
||||||
DEPENDENCIES = ['nest']
|
DEPENDENCIES = ['nest']
|
||||||
BINARY_TYPES = ['fan',
|
BINARY_TYPES = ['fan',
|
||||||
|
@ -12,8 +12,8 @@ import time
|
|||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import (BinarySensorDevice,
|
from homeassistant.components.binary_sensor import (
|
||||||
SENSOR_CLASSES)
|
SENSOR_CLASSES, BinarySensorDevice)
|
||||||
|
|
||||||
REQUIREMENTS = ['pynx584==0.2']
|
REQUIREMENTS = ['pynx584==0.2']
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
@ -8,10 +8,10 @@ https://home-assistant.io/components/binary_sensor.rest/
|
|||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from homeassistant.components.binary_sensor import BinarySensorDevice
|
||||||
|
from homeassistant.components.sensor.rest import RestData
|
||||||
from homeassistant.const import CONF_VALUE_TEMPLATE
|
from homeassistant.const import CONF_VALUE_TEMPLATE
|
||||||
from homeassistant.util import template
|
from homeassistant.util import template
|
||||||
from homeassistant.components.sensor.rest import RestData
|
|
||||||
from homeassistant.components.binary_sensor import BinarySensorDevice
|
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -8,9 +8,10 @@ https://home-assistant.io/components/binary_sensor.rpi_gpio/
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import homeassistant.components.rpi_gpio as rpi_gpio
|
import homeassistant.components.rpi_gpio as rpi_gpio
|
||||||
from homeassistant.components.binary_sensor import BinarySensorDevice
|
from homeassistant.components.binary_sensor import BinarySensorDevice
|
||||||
from homeassistant.const import (DEVICE_DEFAULT_NAME)
|
from homeassistant.const import DEVICE_DEFAULT_NAME
|
||||||
|
|
||||||
DEFAULT_PULL_MODE = "UP"
|
DEFAULT_PULL_MODE = "UP"
|
||||||
DEFAULT_BOUNCETIME = 50
|
DEFAULT_BOUNCETIME = 50
|
||||||
|
@ -10,7 +10,6 @@ from homeassistant.components.binary_sensor import BinarySensorDevice
|
|||||||
from homeassistant.components.zigbee import (
|
from homeassistant.components.zigbee import (
|
||||||
ZigBeeDigitalIn, ZigBeeDigitalInConfig)
|
ZigBeeDigitalIn, ZigBeeDigitalInConfig)
|
||||||
|
|
||||||
|
|
||||||
DEPENDENCIES = ["zigbee"]
|
DEPENDENCIES = ["zigbee"]
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,10 +8,12 @@ https://home-assistant.io/components/bloomsky/
|
|||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
from homeassistant.util import Throttle
|
|
||||||
from homeassistant.helpers import validate_config
|
|
||||||
from homeassistant.const import CONF_API_KEY
|
from homeassistant.const import CONF_API_KEY
|
||||||
|
from homeassistant.helpers import validate_config
|
||||||
|
from homeassistant.util import Throttle
|
||||||
|
|
||||||
DOMAIN = "bloomsky"
|
DOMAIN = "bloomsky"
|
||||||
BLOOMSKY = None
|
BLOOMSKY = None
|
||||||
|
@ -7,9 +7,11 @@ For more details about this component, please refer to the documentation at
|
|||||||
https://home-assistant.io/components/camera.bloomsky/
|
https://home-assistant.io/components/camera.bloomsky/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
from homeassistant.loader import get_component
|
|
||||||
from homeassistant.components.camera import Camera
|
from homeassistant.components.camera import Camera
|
||||||
|
from homeassistant.loader import get_component
|
||||||
|
|
||||||
DEPENDENCIES = ["bloomsky"]
|
DEPENDENCIES = ["bloomsky"]
|
||||||
|
|
||||||
|
@ -4,8 +4,9 @@ homeassistant.components.camera.demo
|
|||||||
Demo platform that has a fake camera.
|
Demo platform that has a fake camera.
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
from homeassistant.components.camera import Camera
|
|
||||||
import homeassistant.util.dt as dt_util
|
import homeassistant.util.dt as dt_util
|
||||||
|
from homeassistant.components.camera import Camera
|
||||||
|
|
||||||
|
|
||||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
|
@ -10,8 +10,8 @@ import logging
|
|||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from homeassistant.helpers import validate_config
|
|
||||||
from homeassistant.components.camera import DOMAIN, Camera
|
from homeassistant.components.camera import DOMAIN, Camera
|
||||||
|
from homeassistant.helpers import validate_config
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -11,8 +11,8 @@ import logging
|
|||||||
import requests
|
import requests
|
||||||
from requests.auth import HTTPBasicAuth
|
from requests.auth import HTTPBasicAuth
|
||||||
|
|
||||||
from homeassistant.helpers import validate_config
|
|
||||||
from homeassistant.components.camera import DOMAIN, Camera
|
from homeassistant.components.camera import DOMAIN, Camera
|
||||||
|
from homeassistant.helpers import validate_config
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -6,15 +6,15 @@ Support for IP Cameras.
|
|||||||
For more details about this platform, please refer to the documentation at
|
For more details about this platform, please refer to the documentation at
|
||||||
https://home-assistant.io/components/camera.mjpeg/
|
https://home-assistant.io/components/camera.mjpeg/
|
||||||
"""
|
"""
|
||||||
from contextlib import closing
|
|
||||||
import logging
|
import logging
|
||||||
|
from contextlib import closing
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
from requests.auth import HTTPBasicAuth
|
from requests.auth import HTTPBasicAuth
|
||||||
|
|
||||||
from homeassistant.helpers import validate_config
|
|
||||||
from homeassistant.components.camera import DOMAIN, Camera
|
from homeassistant.components.camera import DOMAIN, Camera
|
||||||
from homeassistant.const import HTTP_OK
|
from homeassistant.const import HTTP_OK
|
||||||
|
from homeassistant.helpers import validate_config
|
||||||
|
|
||||||
CONTENT_TYPE_HEADER = 'Content-Type'
|
CONTENT_TYPE_HEADER = 'Content-Type'
|
||||||
|
|
||||||
|
@ -11,8 +11,8 @@ import socket
|
|||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from homeassistant.helpers import validate_config
|
|
||||||
from homeassistant.components.camera import DOMAIN, Camera
|
from homeassistant.components.camera import DOMAIN, Camera
|
||||||
|
from homeassistant.helpers import validate_config
|
||||||
|
|
||||||
REQUIREMENTS = ['uvcclient==0.6']
|
REQUIREMENTS = ['uvcclient==0.6']
|
||||||
|
|
||||||
|
@ -11,8 +11,8 @@ the user has submitted configuration information.
|
|||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.helpers.entity import generate_entity_id
|
|
||||||
from homeassistant.const import EVENT_TIME_CHANGED
|
from homeassistant.const import EVENT_TIME_CHANGED
|
||||||
|
from homeassistant.helpers.entity import generate_entity_id
|
||||||
|
|
||||||
DOMAIN = "configurator"
|
DOMAIN = "configurator"
|
||||||
ENTITY_ID_FORMAT = DOMAIN + ".{}"
|
ENTITY_ID_FORMAT = DOMAIN + ".{}"
|
||||||
|
@ -9,10 +9,9 @@ https://home-assistant.io/components/conversation/
|
|||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
|
||||||
from homeassistant import core
|
from homeassistant import core
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_ENTITY_ID, SERVICE_TURN_ON, SERVICE_TURN_OFF)
|
ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_ON)
|
||||||
|
|
||||||
DOMAIN = "conversation"
|
DOMAIN = "conversation"
|
||||||
|
|
||||||
|
@ -6,11 +6,10 @@ Sets up a demo environment that mimics interaction with devices.
|
|||||||
"""
|
"""
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import homeassistant.core as ha
|
|
||||||
import homeassistant.bootstrap as bootstrap
|
import homeassistant.bootstrap as bootstrap
|
||||||
|
import homeassistant.core as ha
|
||||||
import homeassistant.loader as loader
|
import homeassistant.loader as loader
|
||||||
from homeassistant.const import (
|
from homeassistant.const import ATTR_ENTITY_ID, CONF_PLATFORM
|
||||||
CONF_PLATFORM, ATTR_ENTITY_ID)
|
|
||||||
|
|
||||||
DOMAIN = "demo"
|
DOMAIN = "demo"
|
||||||
|
|
||||||
|
@ -10,10 +10,11 @@ https://home-assistant.io/components/device_sun_light_trigger/
|
|||||||
import logging
|
import logging
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
from homeassistant.helpers.event import track_point_in_time, track_state_change
|
|
||||||
import homeassistant.util.dt as dt_util
|
import homeassistant.util.dt as dt_util
|
||||||
from homeassistant.const import STATE_HOME, STATE_NOT_HOME
|
from homeassistant.const import STATE_HOME, STATE_NOT_HOME
|
||||||
from . import light, sun, device_tracker, group
|
from homeassistant.helpers.event import track_point_in_time, track_state_change
|
||||||
|
|
||||||
|
from . import device_tracker, group, light, sun
|
||||||
|
|
||||||
DOMAIN = "device_sun_light_trigger"
|
DOMAIN = "device_sun_light_trigger"
|
||||||
DEPENDENCIES = ['light', 'device_tracker', 'group', 'sun']
|
DEPENDENCIES = ['light', 'device_tracker', 'group', 'sun']
|
||||||
|
@ -8,17 +8,17 @@ For more details about this platform, please refer to the documentation at
|
|||||||
https://home-assistant.io/components/device_tracker.actiontec/
|
https://home-assistant.io/components/device_tracker.actiontec/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
from datetime import timedelta
|
|
||||||
from collections import namedtuple
|
|
||||||
import re
|
import re
|
||||||
import threading
|
|
||||||
import telnetlib
|
import telnetlib
|
||||||
|
import threading
|
||||||
|
from collections import namedtuple
|
||||||
|
from datetime import timedelta
|
||||||
|
|
||||||
import homeassistant.util.dt as dt_util
|
import homeassistant.util.dt as dt_util
|
||||||
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
|
from homeassistant.components.device_tracker import DOMAIN
|
||||||
|
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
|
||||||
from homeassistant.helpers import validate_config
|
from homeassistant.helpers import validate_config
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
from homeassistant.components.device_tracker import DOMAIN
|
|
||||||
|
|
||||||
# Return cached results if last scan was less then this time ago
|
# Return cached results if last scan was less then this time ago
|
||||||
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
|
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
|
||||||
|
@ -8,14 +8,14 @@ For more details about this platform, please refer to the documentation at
|
|||||||
https://home-assistant.io/components/device_tracker.aruba/
|
https://home-assistant.io/components/device_tracker.aruba/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
from datetime import timedelta
|
|
||||||
import re
|
import re
|
||||||
import threading
|
import threading
|
||||||
|
from datetime import timedelta
|
||||||
|
|
||||||
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
|
from homeassistant.components.device_tracker import DOMAIN
|
||||||
|
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
|
||||||
from homeassistant.helpers import validate_config
|
from homeassistant.helpers import validate_config
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
from homeassistant.components.device_tracker import DOMAIN
|
|
||||||
|
|
||||||
# Return cached results if last scan was less then this time ago
|
# Return cached results if last scan was less then this time ago
|
||||||
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
|
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
|
||||||
|
@ -8,15 +8,15 @@ For more details about this platform, please refer to the documentation at
|
|||||||
https://home-assistant.io/components/device_tracker.asuswrt/
|
https://home-assistant.io/components/device_tracker.asuswrt/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
from datetime import timedelta
|
|
||||||
import re
|
import re
|
||||||
import threading
|
|
||||||
import telnetlib
|
import telnetlib
|
||||||
|
import threading
|
||||||
|
from datetime import timedelta
|
||||||
|
|
||||||
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
|
from homeassistant.components.device_tracker import DOMAIN
|
||||||
|
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
|
||||||
from homeassistant.helpers import validate_config
|
from homeassistant.helpers import validate_config
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
from homeassistant.components.device_tracker import DOMAIN
|
|
||||||
|
|
||||||
# Return cached results if last scan was less then this time ago
|
# Return cached results if last scan was less then this time ago
|
||||||
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
|
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
|
||||||
|
@ -8,15 +8,16 @@ For more details about this platform, please refer to the documentation at
|
|||||||
https://home-assistant.io/components/device_tracker.ddwrt/
|
https://home-assistant.io/components/device_tracker.ddwrt/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
from datetime import timedelta
|
|
||||||
import re
|
import re
|
||||||
import threading
|
import threading
|
||||||
|
from datetime import timedelta
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
|
from homeassistant.components.device_tracker import DOMAIN
|
||||||
|
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
|
||||||
from homeassistant.helpers import validate_config
|
from homeassistant.helpers import validate_config
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
from homeassistant.components.device_tracker import DOMAIN
|
|
||||||
|
|
||||||
# Return cached results if last scan was less then this time ago
|
# Return cached results if last scan was less then this time ago
|
||||||
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
|
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
|
||||||
|
@ -10,10 +10,10 @@ https://home-assistant.io/components/device_tracker.fritz/
|
|||||||
import logging
|
import logging
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
|
from homeassistant.components.device_tracker import DOMAIN
|
||||||
|
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
|
||||||
from homeassistant.helpers import validate_config
|
from homeassistant.helpers import validate_config
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
from homeassistant.components.device_tracker import DOMAIN
|
|
||||||
|
|
||||||
REQUIREMENTS = ['fritzconnection==0.4.6']
|
REQUIREMENTS = ['fritzconnection==0.4.6']
|
||||||
|
|
||||||
|
@ -7,9 +7,9 @@ For more details about this platform, please refer to the documentation at
|
|||||||
https://home-assistant.io/components/device_tracker.icloud/
|
https://home-assistant.io/components/device_tracker.icloud/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import re
|
import re
|
||||||
from homeassistant.const import CONF_USERNAME, CONF_PASSWORD
|
|
||||||
|
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
||||||
from homeassistant.helpers.event import track_utc_time_change
|
from homeassistant.helpers.event import track_utc_time_change
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
@ -9,9 +9,8 @@ https://home-assistant.io/components/device_tracker.locative/
|
|||||||
import logging
|
import logging
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
from homeassistant.const import (
|
|
||||||
HTTP_UNPROCESSABLE_ENTITY, STATE_NOT_HOME)
|
|
||||||
from homeassistant.components.device_tracker import DOMAIN
|
from homeassistant.components.device_tracker import DOMAIN
|
||||||
|
from homeassistant.const import HTTP_UNPROCESSABLE_ENTITY, STATE_NOT_HOME
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -7,17 +7,18 @@ presence.
|
|||||||
For more details about this platform, please refer to the documentation at
|
For more details about this platform, please refer to the documentation at
|
||||||
https://home-assistant.io/components/device_tracker.luci/
|
https://home-assistant.io/components/device_tracker.luci/
|
||||||
"""
|
"""
|
||||||
import logging
|
|
||||||
import json
|
import json
|
||||||
from datetime import timedelta
|
import logging
|
||||||
import re
|
import re
|
||||||
import threading
|
import threading
|
||||||
|
from datetime import timedelta
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
|
from homeassistant.components.device_tracker import DOMAIN
|
||||||
|
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
|
||||||
from homeassistant.helpers import validate_config
|
from homeassistant.helpers import validate_config
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
from homeassistant.components.device_tracker import DOMAIN
|
|
||||||
|
|
||||||
# Return cached results if last scan was less then this time ago
|
# Return cached results if last scan was less then this time ago
|
||||||
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
|
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
|
||||||
|
@ -7,8 +7,9 @@ For more details about this platform, please refer to the documentation at
|
|||||||
https://home-assistant.io/components/device_tracker.mqtt/
|
https://home-assistant.io/components/device_tracker.mqtt/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
from homeassistant import util
|
|
||||||
import homeassistant.components.mqtt as mqtt
|
import homeassistant.components.mqtt as mqtt
|
||||||
|
from homeassistant import util
|
||||||
|
|
||||||
DEPENDENCIES = ['mqtt']
|
DEPENDENCIES = ['mqtt']
|
||||||
|
|
||||||
|
@ -8,12 +8,12 @@ For more details about this platform, please refer to the documentation at
|
|||||||
https://home-assistant.io/components/device_tracker.netgear/
|
https://home-assistant.io/components/device_tracker.netgear/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
from datetime import timedelta
|
|
||||||
import threading
|
import threading
|
||||||
|
from datetime import timedelta
|
||||||
|
|
||||||
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
|
|
||||||
from homeassistant.util import Throttle
|
|
||||||
from homeassistant.components.device_tracker import DOMAIN
|
from homeassistant.components.device_tracker import DOMAIN
|
||||||
|
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
|
||||||
|
from homeassistant.util import Throttle
|
||||||
|
|
||||||
# Return cached results if last scan was less then this time ago
|
# Return cached results if last scan was less then this time ago
|
||||||
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
|
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
|
||||||
|
@ -7,16 +7,16 @@ For more details about this platform, please refer to the documentation at
|
|||||||
https://home-assistant.io/components/device_tracker.nmap_scanner/
|
https://home-assistant.io/components/device_tracker.nmap_scanner/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
from datetime import timedelta
|
|
||||||
from collections import namedtuple
|
|
||||||
import subprocess
|
|
||||||
import re
|
import re
|
||||||
|
import subprocess
|
||||||
|
from collections import namedtuple
|
||||||
|
from datetime import timedelta
|
||||||
|
|
||||||
import homeassistant.util.dt as dt_util
|
import homeassistant.util.dt as dt_util
|
||||||
|
from homeassistant.components.device_tracker import DOMAIN
|
||||||
from homeassistant.const import CONF_HOSTS
|
from homeassistant.const import CONF_HOSTS
|
||||||
from homeassistant.helpers import validate_config
|
from homeassistant.helpers import validate_config
|
||||||
from homeassistant.util import Throttle, convert
|
from homeassistant.util import Throttle, convert
|
||||||
from homeassistant.components.device_tracker import DOMAIN
|
|
||||||
|
|
||||||
# Return cached results if last scan was less then this time ago
|
# Return cached results if last scan was less then this time ago
|
||||||
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
|
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
|
||||||
|
@ -7,15 +7,15 @@ through SNMP.
|
|||||||
For more details about this platform, please refer to the documentation at
|
For more details about this platform, please refer to the documentation at
|
||||||
https://home-assistant.io/components/device_tracker.snmp/
|
https://home-assistant.io/components/device_tracker.snmp/
|
||||||
"""
|
"""
|
||||||
import logging
|
|
||||||
from datetime import timedelta
|
|
||||||
import threading
|
|
||||||
import binascii
|
import binascii
|
||||||
|
import logging
|
||||||
|
import threading
|
||||||
|
from datetime import timedelta
|
||||||
|
|
||||||
|
from homeassistant.components.device_tracker import DOMAIN
|
||||||
from homeassistant.const import CONF_HOST
|
from homeassistant.const import CONF_HOST
|
||||||
from homeassistant.helpers import validate_config
|
from homeassistant.helpers import validate_config
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
from homeassistant.components.device_tracker import DOMAIN
|
|
||||||
|
|
||||||
# Return cached results if last scan was less then this time ago
|
# Return cached results if last scan was less then this time ago
|
||||||
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
|
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
|
||||||
|
@ -8,15 +8,15 @@ For more details about this platform, please refer to the documentation at
|
|||||||
https://home-assistant.io/components/device_tracker.thomson/
|
https://home-assistant.io/components/device_tracker.thomson/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
from datetime import timedelta
|
|
||||||
import re
|
import re
|
||||||
import threading
|
|
||||||
import telnetlib
|
import telnetlib
|
||||||
|
import threading
|
||||||
|
from datetime import timedelta
|
||||||
|
|
||||||
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
|
from homeassistant.components.device_tracker import DOMAIN
|
||||||
|
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
|
||||||
from homeassistant.helpers import validate_config
|
from homeassistant.helpers import validate_config
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
from homeassistant.components.device_tracker import DOMAIN
|
|
||||||
|
|
||||||
# Return cached results if last scan was less then this time ago
|
# Return cached results if last scan was less then this time ago
|
||||||
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
|
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
|
||||||
|
@ -7,18 +7,18 @@ presence.
|
|||||||
For more details about this platform, please refer to the documentation at
|
For more details about this platform, please refer to the documentation at
|
||||||
https://home-assistant.io/components/device_tracker.tomato/
|
https://home-assistant.io/components/device_tracker.tomato/
|
||||||
"""
|
"""
|
||||||
import logging
|
|
||||||
import json
|
import json
|
||||||
from datetime import timedelta
|
import logging
|
||||||
import re
|
import re
|
||||||
import threading
|
import threading
|
||||||
|
from datetime import timedelta
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
|
from homeassistant.components.device_tracker import DOMAIN
|
||||||
|
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
|
||||||
from homeassistant.helpers import validate_config
|
from homeassistant.helpers import validate_config
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
from homeassistant.components.device_tracker import DOMAIN
|
|
||||||
|
|
||||||
# Return cached results if last scan was less then this time ago
|
# Return cached results if last scan was less then this time ago
|
||||||
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
|
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
|
||||||
|
@ -9,15 +9,16 @@ https://home-assistant.io/components/device_tracker.tplink/
|
|||||||
"""
|
"""
|
||||||
import base64
|
import base64
|
||||||
import logging
|
import logging
|
||||||
from datetime import timedelta
|
|
||||||
import re
|
import re
|
||||||
import threading
|
import threading
|
||||||
|
from datetime import timedelta
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
|
from homeassistant.components.device_tracker import DOMAIN
|
||||||
|
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
|
||||||
from homeassistant.helpers import validate_config
|
from homeassistant.helpers import validate_config
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
from homeassistant.components.device_tracker import DOMAIN
|
|
||||||
|
|
||||||
# Return cached results if last scan was less then this time ago
|
# Return cached results if last scan was less then this time ago
|
||||||
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
|
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
|
||||||
|
@ -7,17 +7,18 @@ presence.
|
|||||||
For more details about this platform, please refer to the documentation at
|
For more details about this platform, please refer to the documentation at
|
||||||
https://home-assistant.io/components/device_tracker.ubus/
|
https://home-assistant.io/components/device_tracker.ubus/
|
||||||
"""
|
"""
|
||||||
import logging
|
|
||||||
import json
|
import json
|
||||||
from datetime import timedelta
|
import logging
|
||||||
import re
|
import re
|
||||||
import threading
|
import threading
|
||||||
|
from datetime import timedelta
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
|
from homeassistant.components.device_tracker import DOMAIN
|
||||||
|
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
|
||||||
from homeassistant.helpers import validate_config
|
from homeassistant.helpers import validate_config
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
from homeassistant.components.device_tracker import DOMAIN
|
|
||||||
|
|
||||||
# Return cached results if last scan was less then this time ago
|
# Return cached results if last scan was less then this time ago
|
||||||
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
|
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
|
||||||
|
@ -13,8 +13,8 @@ import threading
|
|||||||
|
|
||||||
from homeassistant import bootstrap
|
from homeassistant import bootstrap
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
EVENT_HOMEASSISTANT_START, EVENT_PLATFORM_DISCOVERED,
|
ATTR_DISCOVERED, ATTR_SERVICE, EVENT_HOMEASSISTANT_START,
|
||||||
ATTR_SERVICE, ATTR_DISCOVERED)
|
EVENT_PLATFORM_DISCOVERED)
|
||||||
|
|
||||||
DOMAIN = "discovery"
|
DOMAIN = "discovery"
|
||||||
REQUIREMENTS = ['netdisco==0.5.2']
|
REQUIREMENTS = ['netdisco==0.5.2']
|
||||||
|
@ -6,8 +6,8 @@ Provides functionality to download files.
|
|||||||
For more details about this component, please refer to the documentation at
|
For more details about this component, please refer to the documentation at
|
||||||
https://home-assistant.io/components/downloader/
|
https://home-assistant.io/components/downloader/
|
||||||
"""
|
"""
|
||||||
import os
|
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
import re
|
import re
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
|
@ -6,15 +6,15 @@ Ecobee component
|
|||||||
For more details about this component, please refer to the documentation at
|
For more details about this component, please refer to the documentation at
|
||||||
https://home-assistant.io/components/ecobee/
|
https://home-assistant.io/components/ecobee/
|
||||||
"""
|
"""
|
||||||
from datetime import timedelta
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
from datetime import timedelta
|
||||||
|
|
||||||
from homeassistant.loader import get_component
|
|
||||||
from homeassistant import bootstrap
|
from homeassistant import bootstrap
|
||||||
from homeassistant.util import Throttle
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
EVENT_PLATFORM_DISCOVERED, ATTR_SERVICE, ATTR_DISCOVERED, CONF_API_KEY)
|
ATTR_DISCOVERED, ATTR_SERVICE, CONF_API_KEY, EVENT_PLATFORM_DISCOVERED)
|
||||||
|
from homeassistant.loader import get_component
|
||||||
|
from homeassistant.util import Throttle
|
||||||
|
|
||||||
DOMAIN = "ecobee"
|
DOMAIN = "ecobee"
|
||||||
DISCOVER_THERMOSTAT = "ecobee.thermostat"
|
DISCOVER_THERMOSTAT = "ecobee.thermostat"
|
||||||
|
@ -14,8 +14,7 @@ import threading
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
EVENT_STATE_CHANGED,
|
EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP, EVENT_STATE_CHANGED)
|
||||||
EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP)
|
|
||||||
from homeassistant.helpers import state
|
from homeassistant.helpers import state
|
||||||
|
|
||||||
DOMAIN = "graphite"
|
DOMAIN = "graphite"
|
||||||
|
@ -7,13 +7,12 @@ For more details about this component, please refer to the documentation at
|
|||||||
https://home-assistant.io/components/group/
|
https://home-assistant.io/components/group/
|
||||||
"""
|
"""
|
||||||
import homeassistant.core as ha
|
import homeassistant.core as ha
|
||||||
from homeassistant.helpers.event import track_state_change
|
|
||||||
from homeassistant.helpers.entity import (
|
|
||||||
Entity, split_entity_id, generate_entity_id)
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_ENTITY_ID, STATE_ON, STATE_OFF,
|
ATTR_ENTITY_ID, CONF_ICON, CONF_NAME, STATE_CLOSED, STATE_HOME,
|
||||||
STATE_HOME, STATE_NOT_HOME, STATE_OPEN, STATE_CLOSED,
|
STATE_NOT_HOME, STATE_OFF, STATE_ON, STATE_OPEN, STATE_UNKNOWN)
|
||||||
STATE_UNKNOWN, CONF_NAME, CONF_ICON)
|
from homeassistant.helpers.entity import (
|
||||||
|
Entity, generate_entity_id, split_entity_id)
|
||||||
|
from homeassistant.helpers.event import track_state_change
|
||||||
|
|
||||||
DOMAIN = 'group'
|
DOMAIN = 'group'
|
||||||
|
|
||||||
|
@ -7,12 +7,12 @@ For more details about this component, please refer to the documentation at
|
|||||||
https://home-assistant.io/components/history/
|
https://home-assistant.io/components/history/
|
||||||
"""
|
"""
|
||||||
import re
|
import re
|
||||||
|
from collections import defaultdict
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from itertools import groupby
|
from itertools import groupby
|
||||||
from collections import defaultdict
|
|
||||||
|
|
||||||
import homeassistant.util.dt as dt_util
|
|
||||||
import homeassistant.components.recorder as recorder
|
import homeassistant.components.recorder as recorder
|
||||||
|
import homeassistant.util.dt as dt_util
|
||||||
from homeassistant.const import HTTP_BAD_REQUEST
|
from homeassistant.const import HTTP_BAD_REQUEST
|
||||||
|
|
||||||
DOMAIN = 'history'
|
DOMAIN = 'history'
|
||||||
|
@ -6,30 +6,31 @@ This module provides an API and a HTTP interface for debug purposes.
|
|||||||
For more details about the RESTful API, please refer to the documentation at
|
For more details about the RESTful API, please refer to the documentation at
|
||||||
https://home-assistant.io/developers/api/
|
https://home-assistant.io/developers/api/
|
||||||
"""
|
"""
|
||||||
from datetime import timedelta
|
|
||||||
import gzip
|
import gzip
|
||||||
from http import cookies
|
|
||||||
from http.server import SimpleHTTPRequestHandler, HTTPServer
|
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
from socketserver import ThreadingMixIn
|
|
||||||
import ssl
|
import ssl
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
from urllib.parse import urlparse, parse_qs
|
from datetime import timedelta
|
||||||
|
from http import cookies
|
||||||
|
from http.server import HTTPServer, SimpleHTTPRequestHandler
|
||||||
|
from socketserver import ThreadingMixIn
|
||||||
|
from urllib.parse import parse_qs, urlparse
|
||||||
|
|
||||||
|
import homeassistant.bootstrap as bootstrap
|
||||||
import homeassistant.core as ha
|
import homeassistant.core as ha
|
||||||
from homeassistant.const import (
|
|
||||||
SERVER_PORT, CONTENT_TYPE_JSON, CONTENT_TYPE_TEXT_PLAIN,
|
|
||||||
HTTP_HEADER_HA_AUTH, HTTP_HEADER_CONTENT_TYPE, HTTP_HEADER_ACCEPT_ENCODING,
|
|
||||||
HTTP_HEADER_CONTENT_ENCODING, HTTP_HEADER_VARY, HTTP_HEADER_CONTENT_LENGTH,
|
|
||||||
HTTP_HEADER_CACHE_CONTROL, HTTP_HEADER_EXPIRES, HTTP_OK, HTTP_UNAUTHORIZED,
|
|
||||||
HTTP_NOT_FOUND, HTTP_METHOD_NOT_ALLOWED, HTTP_UNPROCESSABLE_ENTITY)
|
|
||||||
import homeassistant.remote as rem
|
import homeassistant.remote as rem
|
||||||
import homeassistant.util as util
|
import homeassistant.util as util
|
||||||
import homeassistant.util.dt as date_util
|
import homeassistant.util.dt as date_util
|
||||||
import homeassistant.bootstrap as bootstrap
|
from homeassistant.const import (
|
||||||
|
CONTENT_TYPE_JSON, CONTENT_TYPE_TEXT_PLAIN, HTTP_HEADER_ACCEPT_ENCODING,
|
||||||
|
HTTP_HEADER_CACHE_CONTROL, HTTP_HEADER_CONTENT_ENCODING,
|
||||||
|
HTTP_HEADER_CONTENT_LENGTH, HTTP_HEADER_CONTENT_TYPE, HTTP_HEADER_EXPIRES,
|
||||||
|
HTTP_HEADER_HA_AUTH, HTTP_HEADER_VARY, HTTP_METHOD_NOT_ALLOWED,
|
||||||
|
HTTP_NOT_FOUND, HTTP_OK, HTTP_UNAUTHORIZED, HTTP_UNPROCESSABLE_ENTITY,
|
||||||
|
SERVER_PORT)
|
||||||
|
|
||||||
DOMAIN = "http"
|
DOMAIN = "http"
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ For more details about this component, please refer to the documentation at
|
|||||||
https://home-assistant.io/components/ifttt/
|
https://home-assistant.io/components/ifttt/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from homeassistant.helpers import validate_config
|
from homeassistant.helpers import validate_config
|
||||||
|
@ -7,10 +7,11 @@ For more details about this component, please refer to the documentation at
|
|||||||
https://home-assistant.io/components/influxdb/
|
https://home-assistant.io/components/influxdb/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import homeassistant.util as util
|
import homeassistant.util as util
|
||||||
from homeassistant.helpers import validate_config
|
from homeassistant.const import EVENT_STATE_CHANGED, STATE_UNKNOWN
|
||||||
from homeassistant.helpers import state as state_helper
|
from homeassistant.helpers import state as state_helper
|
||||||
from homeassistant.const import (EVENT_STATE_CHANGED, STATE_UNKNOWN)
|
from homeassistant.helpers import validate_config
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -9,9 +9,9 @@ at https://home-assistant.io/components/input_boolean/
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
STATE_ON, SERVICE_TURN_ON, SERVICE_TURN_OFF, ATTR_ENTITY_ID)
|
ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_ON, STATE_ON)
|
||||||
from homeassistant.helpers.entity_component import EntityComponent
|
|
||||||
from homeassistant.helpers.entity import ToggleEntity
|
from homeassistant.helpers.entity import ToggleEntity
|
||||||
|
from homeassistant.helpers.entity_component import EntityComponent
|
||||||
from homeassistant.util import slugify
|
from homeassistant.util import slugify
|
||||||
|
|
||||||
DOMAIN = 'input_boolean'
|
DOMAIN = 'input_boolean'
|
||||||
|
@ -9,8 +9,8 @@ at https://home-assistant.io/components/input_select/
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.const import ATTR_ENTITY_ID
|
from homeassistant.const import ATTR_ENTITY_ID
|
||||||
from homeassistant.helpers.entity_component import EntityComponent
|
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
|
from homeassistant.helpers.entity_component import EntityComponent
|
||||||
from homeassistant.util import slugify
|
from homeassistant.util import slugify
|
||||||
|
|
||||||
DOMAIN = 'input_select'
|
DOMAIN = 'input_select'
|
||||||
|
@ -7,13 +7,14 @@ For more details about this component, please refer to the documentation at
|
|||||||
https://home-assistant.io/components/insteon_hub/
|
https://home-assistant.io/components/insteon_hub/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import homeassistant.bootstrap as bootstrap
|
import homeassistant.bootstrap as bootstrap
|
||||||
from homeassistant.helpers import validate_config
|
|
||||||
from homeassistant.loader import get_component
|
|
||||||
from homeassistant.helpers.entity import ToggleEntity
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_USERNAME, CONF_PASSWORD, CONF_API_KEY, ATTR_DISCOVERED,
|
ATTR_DISCOVERED, ATTR_SERVICE, CONF_API_KEY, CONF_PASSWORD, CONF_USERNAME,
|
||||||
ATTR_SERVICE, EVENT_PLATFORM_DISCOVERED)
|
EVENT_PLATFORM_DISCOVERED)
|
||||||
|
from homeassistant.helpers import validate_config
|
||||||
|
from homeassistant.helpers.entity import ToggleEntity
|
||||||
|
from homeassistant.loader import get_component
|
||||||
|
|
||||||
DOMAIN = "insteon_hub"
|
DOMAIN = "insteon_hub"
|
||||||
REQUIREMENTS = ['insteon_hub==0.4.5']
|
REQUIREMENTS = ['insteon_hub==0.4.5']
|
||||||
|
@ -11,12 +11,12 @@ import logging
|
|||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
from homeassistant import bootstrap
|
from homeassistant import bootstrap
|
||||||
from homeassistant.loader import get_component
|
from homeassistant.const import (
|
||||||
|
ATTR_DISCOVERED, ATTR_SERVICE, CONF_HOST, CONF_PASSWORD, CONF_USERNAME,
|
||||||
|
EVENT_HOMEASSISTANT_STOP, EVENT_PLATFORM_DISCOVERED)
|
||||||
from homeassistant.helpers import validate_config
|
from homeassistant.helpers import validate_config
|
||||||
from homeassistant.helpers.entity import ToggleEntity
|
from homeassistant.helpers.entity import ToggleEntity
|
||||||
from homeassistant.const import (
|
from homeassistant.loader import get_component
|
||||||
CONF_HOST, CONF_USERNAME, CONF_PASSWORD, EVENT_PLATFORM_DISCOVERED,
|
|
||||||
EVENT_HOMEASSISTANT_STOP, ATTR_SERVICE, ATTR_DISCOVERED)
|
|
||||||
|
|
||||||
DOMAIN = "isy994"
|
DOMAIN = "isy994"
|
||||||
REQUIREMENTS = ['PyISY==1.0.5']
|
REQUIREMENTS = ['PyISY==1.0.5']
|
||||||
|
@ -7,10 +7,9 @@ For more details about this component, please refer to the documentation at
|
|||||||
https://home-assistant.io/components/keyboard/
|
https://home-assistant.io/components/keyboard/
|
||||||
"""
|
"""
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
SERVICE_VOLUME_UP, SERVICE_VOLUME_DOWN, SERVICE_VOLUME_MUTE,
|
SERVICE_MEDIA_NEXT_TRACK, SERVICE_MEDIA_PLAY_PAUSE,
|
||||||
SERVICE_MEDIA_NEXT_TRACK, SERVICE_MEDIA_PREVIOUS_TRACK,
|
SERVICE_MEDIA_PREVIOUS_TRACK, SERVICE_VOLUME_DOWN, SERVICE_VOLUME_MUTE,
|
||||||
SERVICE_MEDIA_PLAY_PAUSE)
|
SERVICE_VOLUME_UP)
|
||||||
|
|
||||||
|
|
||||||
DOMAIN = "keyboard"
|
DOMAIN = "keyboard"
|
||||||
REQUIREMENTS = ['pyuserinput==0.1.9']
|
REQUIREMENTS = ['pyuserinput==0.1.9']
|
||||||
|
@ -8,7 +8,7 @@ https://home-assistant.io/components/light.blinksticklight/
|
|||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.components.light import Light, ATTR_RGB_COLOR
|
from homeassistant.components.light import ATTR_RGB_COLOR, Light
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -7,8 +7,7 @@ Demo platform that implements lights.
|
|||||||
import random
|
import random
|
||||||
|
|
||||||
from homeassistant.components.light import (
|
from homeassistant.components.light import (
|
||||||
Light, ATTR_BRIGHTNESS, ATTR_RGB_COLOR, ATTR_COLOR_TEMP)
|
ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_RGB_COLOR, Light)
|
||||||
|
|
||||||
|
|
||||||
LIGHT_COLORS = [
|
LIGHT_COLORS = [
|
||||||
[237, 224, 33],
|
[237, 224, 33],
|
||||||
|
@ -9,19 +9,19 @@ https://home-assistant.io/components/light.hue/
|
|||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import socket
|
|
||||||
import random
|
import random
|
||||||
|
import socket
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
from homeassistant.loader import get_component
|
|
||||||
import homeassistant.util as util
|
import homeassistant.util as util
|
||||||
import homeassistant.util.color as color_util
|
import homeassistant.util.color as color_util
|
||||||
from homeassistant.const import CONF_HOST, CONF_FILENAME, DEVICE_DEFAULT_NAME
|
|
||||||
from homeassistant.components.light import (
|
from homeassistant.components.light import (
|
||||||
Light, ATTR_BRIGHTNESS, ATTR_XY_COLOR, ATTR_COLOR_TEMP,
|
ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_EFFECT, ATTR_FLASH, ATTR_RGB_COLOR,
|
||||||
ATTR_TRANSITION, ATTR_FLASH, FLASH_LONG, FLASH_SHORT,
|
ATTR_TRANSITION, ATTR_XY_COLOR, EFFECT_COLORLOOP, EFFECT_RANDOM,
|
||||||
ATTR_EFFECT, EFFECT_COLORLOOP, EFFECT_RANDOM, ATTR_RGB_COLOR)
|
FLASH_LONG, FLASH_SHORT, Light)
|
||||||
|
from homeassistant.const import CONF_FILENAME, CONF_HOST, DEVICE_DEFAULT_NAME
|
||||||
|
from homeassistant.loader import get_component
|
||||||
|
|
||||||
REQUIREMENTS = ['phue==0.8']
|
REQUIREMENTS = ['phue==0.8']
|
||||||
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
|
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
|
||||||
|
@ -6,12 +6,12 @@ Support for Hyperion remotes.
|
|||||||
For more details about this platform, please refer to the documentation at
|
For more details about this platform, please refer to the documentation at
|
||||||
https://home-assistant.io/components/light.hyperion/
|
https://home-assistant.io/components/light.hyperion/
|
||||||
"""
|
"""
|
||||||
|
import json
|
||||||
import logging
|
import logging
|
||||||
import socket
|
import socket
|
||||||
import json
|
|
||||||
|
|
||||||
|
from homeassistant.components.light import ATTR_RGB_COLOR, Light
|
||||||
from homeassistant.const import CONF_HOST
|
from homeassistant.const import CONF_HOST
|
||||||
from homeassistant.components.light import (Light, ATTR_RGB_COLOR)
|
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
REQUIREMENTS = []
|
REQUIREMENTS = []
|
||||||
|
@ -4,7 +4,7 @@ homeassistant.components.light.insteon
|
|||||||
Support for Insteon Hub lights.
|
Support for Insteon Hub lights.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from homeassistant.components.insteon_hub import (INSTEON, InsteonToggleDevice)
|
from homeassistant.components.insteon_hub import INSTEON, InsteonToggleDevice
|
||||||
|
|
||||||
|
|
||||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
|
@ -8,10 +8,10 @@ https://home-assistant.io/components/isy994/
|
|||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.components.isy994 import (ISYDeviceABC, ISY, SENSOR_STRING,
|
from homeassistant.components.isy994 import (
|
||||||
HIDDEN_STRING)
|
HIDDEN_STRING, ISY, SENSOR_STRING, ISYDeviceABC)
|
||||||
from homeassistant.components.light import ATTR_BRIGHTNESS
|
from homeassistant.components.light import ATTR_BRIGHTNESS
|
||||||
from homeassistant.const import STATE_ON, STATE_OFF
|
from homeassistant.const import STATE_OFF, STATE_ON
|
||||||
|
|
||||||
|
|
||||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
|
@ -8,11 +8,12 @@ https://home-assistant.io/components/light.lifx/
|
|||||||
"""
|
"""
|
||||||
# pylint: disable=missing-docstring
|
# pylint: disable=missing-docstring
|
||||||
|
|
||||||
import logging
|
|
||||||
import colorsys
|
import colorsys
|
||||||
|
import logging
|
||||||
|
|
||||||
|
from homeassistant.components.light import (
|
||||||
|
ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_RGB_COLOR, ATTR_TRANSITION, Light)
|
||||||
from homeassistant.helpers.event import track_time_change
|
from homeassistant.helpers.event import track_time_change
|
||||||
from homeassistant.components.light import \
|
|
||||||
(Light, ATTR_BRIGHTNESS, ATTR_RGB_COLOR, ATTR_COLOR_TEMP, ATTR_TRANSITION)
|
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -8,12 +8,9 @@ https://home-assistant.io/components/light.limitlessled/
|
|||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.components.light import (Light, ATTR_BRIGHTNESS,
|
from homeassistant.components.light import (
|
||||||
ATTR_RGB_COLOR, ATTR_EFFECT,
|
ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_EFFECT, ATTR_FLASH, ATTR_RGB_COLOR,
|
||||||
ATTR_COLOR_TEMP, ATTR_TRANSITION,
|
ATTR_TRANSITION, EFFECT_COLORLOOP, EFFECT_WHITE, FLASH_LONG, Light)
|
||||||
ATTR_FLASH, FLASH_LONG,
|
|
||||||
EFFECT_COLORLOOP, EFFECT_WHITE)
|
|
||||||
|
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
REQUIREMENTS = ['limitlessled==1.0.0']
|
REQUIREMENTS = ['limitlessled==1.0.0']
|
||||||
|
@ -6,12 +6,12 @@ Allows to configure a MQTT light.
|
|||||||
For more details about this platform, please refer to the documentation at
|
For more details about this platform, please refer to the documentation at
|
||||||
https://home-assistant.io/components/light.mqtt/
|
https://home-assistant.io/components/light.mqtt/
|
||||||
"""
|
"""
|
||||||
from functools import partial
|
|
||||||
import logging
|
import logging
|
||||||
|
from functools import partial
|
||||||
|
|
||||||
import homeassistant.components.mqtt as mqtt
|
import homeassistant.components.mqtt as mqtt
|
||||||
from homeassistant.components.light import (Light,
|
from homeassistant.components.light import (
|
||||||
ATTR_BRIGHTNESS, ATTR_RGB_COLOR)
|
ATTR_BRIGHTNESS, ATTR_RGB_COLOR, Light)
|
||||||
from homeassistant.util.template import render_with_possible_json_value
|
from homeassistant.util.template import render_with_possible_json_value
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
@ -6,17 +6,11 @@ https://home-assistant.io/components/light.mysensors/
|
|||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.components.light import (
|
|
||||||
Light, ATTR_BRIGHTNESS, ATTR_RGB_COLOR)
|
|
||||||
|
|
||||||
from homeassistant.util.color import (
|
|
||||||
rgb_hex_to_rgb_list)
|
|
||||||
|
|
||||||
from homeassistant.const import (
|
|
||||||
ATTR_BATTERY_LEVEL,
|
|
||||||
STATE_ON, STATE_OFF)
|
|
||||||
|
|
||||||
import homeassistant.components.mysensors as mysensors
|
import homeassistant.components.mysensors as mysensors
|
||||||
|
from homeassistant.components.light import (
|
||||||
|
ATTR_BRIGHTNESS, ATTR_RGB_COLOR, Light)
|
||||||
|
from homeassistant.const import ATTR_BATTERY_LEVEL, STATE_OFF, STATE_ON
|
||||||
|
from homeassistant.util.color import rgb_hex_to_rgb_list
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
ATTR_RGB_WHITE = 'rgb_white'
|
ATTR_RGB_WHITE = 'rgb_white'
|
||||||
|
@ -7,16 +7,13 @@ For more details about this platform, please refer to the documentation at
|
|||||||
https://home-assistant.io/components/light.rfxtrx/
|
https://home-assistant.io/components/light.rfxtrx/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import homeassistant.components.rfxtrx as rfxtrx
|
import homeassistant.components.rfxtrx as rfxtrx
|
||||||
|
from homeassistant.components.light import ATTR_BRIGHTNESS, Light
|
||||||
from homeassistant.components.light import Light, ATTR_BRIGHTNESS
|
|
||||||
from homeassistant.util import slugify
|
|
||||||
|
|
||||||
from homeassistant.const import ATTR_ENTITY_ID
|
|
||||||
from homeassistant.components.rfxtrx import (
|
from homeassistant.components.rfxtrx import (
|
||||||
ATTR_STATE, ATTR_FIREEVENT, ATTR_PACKETID,
|
ATTR_FIREEVENT, ATTR_NAME, ATTR_PACKETID, ATTR_STATE, EVENT_BUTTON_PRESSED)
|
||||||
ATTR_NAME, EVENT_BUTTON_PRESSED)
|
from homeassistant.const import ATTR_ENTITY_ID
|
||||||
|
from homeassistant.util import slugify
|
||||||
|
|
||||||
DEPENDENCIES = ['rfxtrx']
|
DEPENDENCIES = ['rfxtrx']
|
||||||
SIGNAL_REPETITIONS = 1
|
SIGNAL_REPETITIONS = 1
|
||||||
|
@ -7,10 +7,9 @@ For more details about this platform, please refer to the documentation at
|
|||||||
https://home-assistant.io/components/light.scsgate/
|
https://home-assistant.io/components/light.scsgate/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import homeassistant.components.scsgate as scsgate
|
import homeassistant.components.scsgate as scsgate
|
||||||
|
|
||||||
from homeassistant.components.light import Light
|
from homeassistant.components.light import Light
|
||||||
|
|
||||||
from homeassistant.const import ATTR_ENTITY_ID
|
from homeassistant.const import ATTR_ENTITY_ID
|
||||||
|
|
||||||
DEPENDENCIES = ['scsgate']
|
DEPENDENCIES = ['scsgate']
|
||||||
|
@ -6,8 +6,9 @@ Support for Tellstick lights.
|
|||||||
For more details about this platform, please refer to the documentation at
|
For more details about this platform, please refer to the documentation at
|
||||||
https://home-assistant.io/components/light.tellstick/
|
https://home-assistant.io/components/light.tellstick/
|
||||||
"""
|
"""
|
||||||
from homeassistant.components.light import Light, ATTR_BRIGHTNESS
|
from homeassistant.components.light import ATTR_BRIGHTNESS, Light
|
||||||
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
|
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
|
||||||
|
|
||||||
REQUIREMENTS = ['tellcore-py==1.1.2']
|
REQUIREMENTS = ['tellcore-py==1.1.2']
|
||||||
SIGNAL_REPETITIONS = 1
|
SIGNAL_REPETITIONS = 1
|
||||||
|
|
||||||
|
@ -9,18 +9,12 @@ https://home-assistant.io/components/light.vera/
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from requests.exceptions import RequestException
|
from requests.exceptions import RequestException
|
||||||
|
|
||||||
import homeassistant.util.dt as dt_util
|
import homeassistant.util.dt as dt_util
|
||||||
|
from homeassistant.components.light import ATTR_BRIGHTNESS, Light
|
||||||
from homeassistant.components.light import Light, ATTR_BRIGHTNESS
|
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_BATTERY_LEVEL,
|
ATTR_ARMED, ATTR_BATTERY_LEVEL, ATTR_LAST_TRIP_TIME, ATTR_TRIPPED,
|
||||||
ATTR_TRIPPED,
|
EVENT_HOMEASSISTANT_STOP, STATE_OFF, STATE_ON)
|
||||||
ATTR_ARMED,
|
|
||||||
ATTR_LAST_TRIP_TIME,
|
|
||||||
EVENT_HOMEASSISTANT_STOP,
|
|
||||||
STATE_ON,
|
|
||||||
STATE_OFF)
|
|
||||||
|
|
||||||
REQUIREMENTS = ['pyvera==0.2.8']
|
REQUIREMENTS = ['pyvera==0.2.8']
|
||||||
|
|
||||||
|
@ -10,7 +10,6 @@ from homeassistant.components.light import Light
|
|||||||
from homeassistant.components.zigbee import (
|
from homeassistant.components.zigbee import (
|
||||||
ZigBeeDigitalOut, ZigBeeDigitalOutConfig)
|
ZigBeeDigitalOut, ZigBeeDigitalOutConfig)
|
||||||
|
|
||||||
|
|
||||||
DEPENDENCIES = ["zigbee"]
|
DEPENDENCIES = ["zigbee"]
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,11 +10,11 @@ https://home-assistant.io/components/light.zwave/
|
|||||||
# pylint: disable=import-error
|
# pylint: disable=import-error
|
||||||
from threading import Timer
|
from threading import Timer
|
||||||
|
|
||||||
from homeassistant.const import STATE_ON, STATE_OFF
|
from homeassistant.components.light import ATTR_BRIGHTNESS, DOMAIN, Light
|
||||||
from homeassistant.components.light import Light, ATTR_BRIGHTNESS, DOMAIN
|
|
||||||
from homeassistant.components.zwave import (
|
from homeassistant.components.zwave import (
|
||||||
COMMAND_CLASS_SWITCH_MULTILEVEL, TYPE_BYTE, GENRE_USER, NETWORK,
|
ATTR_NODE_ID, ATTR_VALUE_ID, COMMAND_CLASS_SWITCH_MULTILEVEL, GENRE_USER,
|
||||||
ATTR_NODE_ID, ATTR_VALUE_ID, ZWaveDeviceEntity)
|
NETWORK, TYPE_BYTE, ZWaveDeviceEntity)
|
||||||
|
from homeassistant.const import STATE_OFF, STATE_ON
|
||||||
|
|
||||||
|
|
||||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
|
@ -10,10 +10,7 @@ import logging
|
|||||||
|
|
||||||
import homeassistant.components.verisure as verisure
|
import homeassistant.components.verisure as verisure
|
||||||
from homeassistant.components.lock import LockDevice
|
from homeassistant.components.lock import LockDevice
|
||||||
|
from homeassistant.const import STATE_LOCKED, STATE_UNKNOWN, STATE_UNLOCKED
|
||||||
from homeassistant.const import (
|
|
||||||
STATE_UNKNOWN,
|
|
||||||
STATE_LOCKED, STATE_UNLOCKED)
|
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
ATTR_CODE = 'code'
|
ATTR_CODE = 'code'
|
||||||
|
@ -7,16 +7,17 @@ For more details about this component, please refer to the documentation at
|
|||||||
https://home-assistant.io/components/logbook/
|
https://home-assistant.io/components/logbook/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
import re
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from itertools import groupby
|
from itertools import groupby
|
||||||
import re
|
|
||||||
|
|
||||||
from homeassistant.core import State, DOMAIN as HA_DOMAIN
|
|
||||||
from homeassistant.const import (
|
|
||||||
EVENT_STATE_CHANGED, STATE_NOT_HOME, STATE_ON, STATE_OFF,
|
|
||||||
EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP, HTTP_BAD_REQUEST)
|
|
||||||
import homeassistant.util.dt as dt_util
|
import homeassistant.util.dt as dt_util
|
||||||
from homeassistant.components import recorder, sun
|
from homeassistant.components import recorder, sun
|
||||||
|
from homeassistant.const import (
|
||||||
|
EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP, EVENT_STATE_CHANGED,
|
||||||
|
HTTP_BAD_REQUEST, STATE_NOT_HOME, STATE_OFF, STATE_ON)
|
||||||
|
from homeassistant.core import DOMAIN as HA_DOMAIN
|
||||||
|
from homeassistant.core import State
|
||||||
from homeassistant.helpers.entity import split_entity_id
|
from homeassistant.helpers.entity import split_entity_id
|
||||||
from homeassistant.util import template
|
from homeassistant.util import template
|
||||||
|
|
||||||
|
@ -9,16 +9,14 @@ https://home-assistant.io/components/media_player.cast/
|
|||||||
# pylint: disable=import-error
|
# pylint: disable=import-error
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.const import (
|
|
||||||
STATE_PLAYING, STATE_PAUSED, STATE_IDLE, STATE_OFF,
|
|
||||||
STATE_UNKNOWN, CONF_HOST)
|
|
||||||
|
|
||||||
from homeassistant.components.media_player import (
|
from homeassistant.components.media_player import (
|
||||||
MediaPlayerDevice,
|
MEDIA_TYPE_MUSIC, MEDIA_TYPE_TVSHOW, MEDIA_TYPE_VIDEO, SUPPORT_NEXT_TRACK,
|
||||||
SUPPORT_PAUSE, SUPPORT_VOLUME_SET, SUPPORT_VOLUME_MUTE,
|
SUPPORT_PAUSE, SUPPORT_PLAY_MEDIA, SUPPORT_PREVIOUS_TRACK,
|
||||||
SUPPORT_TURN_ON, SUPPORT_TURN_OFF, SUPPORT_PLAY_MEDIA,
|
SUPPORT_TURN_OFF, SUPPORT_TURN_ON, SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_SET,
|
||||||
SUPPORT_PREVIOUS_TRACK, SUPPORT_NEXT_TRACK,
|
MediaPlayerDevice)
|
||||||
MEDIA_TYPE_MUSIC, MEDIA_TYPE_TVSHOW, MEDIA_TYPE_VIDEO)
|
from homeassistant.const import (
|
||||||
|
CONF_HOST, STATE_IDLE, STATE_OFF, STATE_PAUSED, STATE_PLAYING,
|
||||||
|
STATE_UNKNOWN)
|
||||||
|
|
||||||
REQUIREMENTS = ['pychromecast==0.7.1']
|
REQUIREMENTS = ['pychromecast==0.7.1']
|
||||||
CONF_IGNORE_CEC = 'ignore_cec'
|
CONF_IGNORE_CEC = 'ignore_cec'
|
||||||
|
@ -3,15 +3,12 @@ homeassistant.components.media_player.demo
|
|||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
Demo implementation of the media player.
|
Demo implementation of the media player.
|
||||||
"""
|
"""
|
||||||
from homeassistant.const import (
|
|
||||||
STATE_PLAYING, STATE_PAUSED, STATE_OFF)
|
|
||||||
|
|
||||||
from homeassistant.components.media_player import (
|
from homeassistant.components.media_player import (
|
||||||
MediaPlayerDevice,
|
MEDIA_TYPE_MUSIC, MEDIA_TYPE_TVSHOW, MEDIA_TYPE_VIDEO, SUPPORT_NEXT_TRACK,
|
||||||
MEDIA_TYPE_VIDEO, MEDIA_TYPE_MUSIC, MEDIA_TYPE_TVSHOW,
|
SUPPORT_PAUSE, SUPPORT_PLAY_MEDIA, SUPPORT_PREVIOUS_TRACK,
|
||||||
SUPPORT_PAUSE, SUPPORT_VOLUME_SET, SUPPORT_VOLUME_MUTE,
|
SUPPORT_TURN_OFF, SUPPORT_TURN_ON, SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_SET,
|
||||||
SUPPORT_TURN_ON, SUPPORT_TURN_OFF, SUPPORT_PREVIOUS_TRACK,
|
MediaPlayerDevice)
|
||||||
SUPPORT_NEXT_TRACK, SUPPORT_PLAY_MEDIA)
|
from homeassistant.const import STATE_OFF, STATE_PAUSED, STATE_PLAYING
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=unused-argument
|
# pylint: disable=unused-argument
|
||||||
|
@ -6,16 +6,14 @@ Provides an interface to Denon Network Receivers.
|
|||||||
For more details about this platform, please refer to the documentation at
|
For more details about this platform, please refer to the documentation at
|
||||||
https://home-assistant.io/components/media_player.denon/
|
https://home-assistant.io/components/media_player.denon/
|
||||||
"""
|
"""
|
||||||
import telnetlib
|
|
||||||
import logging
|
import logging
|
||||||
|
import telnetlib
|
||||||
|
|
||||||
from homeassistant.components.media_player import (
|
from homeassistant.components.media_player import (
|
||||||
MediaPlayerDevice, SUPPORT_PAUSE, SUPPORT_VOLUME_SET,
|
DOMAIN, SUPPORT_NEXT_TRACK, SUPPORT_PAUSE, SUPPORT_PREVIOUS_TRACK,
|
||||||
SUPPORT_VOLUME_MUTE, SUPPORT_PREVIOUS_TRACK, SUPPORT_NEXT_TRACK,
|
SUPPORT_TURN_OFF, SUPPORT_TURN_ON, SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_SET,
|
||||||
SUPPORT_TURN_ON, SUPPORT_TURN_OFF,
|
MediaPlayerDevice)
|
||||||
DOMAIN)
|
from homeassistant.const import CONF_HOST, STATE_OFF, STATE_ON, STATE_UNKNOWN
|
||||||
from homeassistant.const import (
|
|
||||||
CONF_HOST, STATE_OFF, STATE_ON, STATE_UNKNOWN)
|
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -7,17 +7,15 @@ For more details about this platform, please refer to the documentation at
|
|||||||
https://home-assistant.io/components/media_player.firetv/
|
https://home-assistant.io/components/media_player.firetv/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from homeassistant.const import (
|
|
||||||
STATE_PLAYING, STATE_PAUSED, STATE_IDLE, STATE_OFF,
|
|
||||||
STATE_UNKNOWN, STATE_STANDBY)
|
|
||||||
|
|
||||||
from homeassistant.components.media_player import (
|
from homeassistant.components.media_player import (
|
||||||
MediaPlayerDevice,
|
SUPPORT_NEXT_TRACK, SUPPORT_PAUSE, SUPPORT_PREVIOUS_TRACK,
|
||||||
SUPPORT_PAUSE, SUPPORT_VOLUME_SET,
|
SUPPORT_TURN_OFF, SUPPORT_TURN_ON, SUPPORT_VOLUME_SET, MediaPlayerDevice)
|
||||||
SUPPORT_TURN_ON, SUPPORT_TURN_OFF,
|
from homeassistant.const import (
|
||||||
SUPPORT_PREVIOUS_TRACK, SUPPORT_NEXT_TRACK)
|
STATE_IDLE, STATE_OFF, STATE_PAUSED, STATE_PLAYING, STATE_STANDBY,
|
||||||
|
STATE_UNKNOWN)
|
||||||
|
|
||||||
SUPPORT_FIRETV = SUPPORT_PAUSE | \
|
SUPPORT_FIRETV = SUPPORT_PAUSE | \
|
||||||
SUPPORT_TURN_ON | SUPPORT_TURN_OFF | SUPPORT_PREVIOUS_TRACK | \
|
SUPPORT_TURN_ON | SUPPORT_TURN_OFF | SUPPORT_PREVIOUS_TRACK | \
|
||||||
|
@ -11,12 +11,12 @@ import logging
|
|||||||
import requests
|
import requests
|
||||||
|
|
||||||
from homeassistant.components.media_player import (
|
from homeassistant.components.media_player import (
|
||||||
MediaPlayerDevice, MEDIA_TYPE_MUSIC, MEDIA_TYPE_PLAYLIST, SUPPORT_PAUSE,
|
MEDIA_TYPE_MUSIC, MEDIA_TYPE_PLAYLIST, SUPPORT_NEXT_TRACK, SUPPORT_PAUSE,
|
||||||
SUPPORT_SEEK, SUPPORT_VOLUME_SET, SUPPORT_VOLUME_MUTE,
|
SUPPORT_PLAY_MEDIA, SUPPORT_PREVIOUS_TRACK, SUPPORT_SEEK, SUPPORT_TURN_OFF,
|
||||||
SUPPORT_PREVIOUS_TRACK, SUPPORT_NEXT_TRACK, SUPPORT_TURN_ON,
|
SUPPORT_TURN_ON, SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_SET,
|
||||||
SUPPORT_TURN_OFF, SUPPORT_PLAY_MEDIA)
|
MediaPlayerDevice)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
STATE_IDLE, STATE_PLAYING, STATE_PAUSED, STATE_OFF, STATE_ON)
|
STATE_IDLE, STATE_OFF, STATE_ON, STATE_PAUSED, STATE_PLAYING)
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -6,14 +6,14 @@ Provides an interface to the XBMC/Kodi JSON-RPC API
|
|||||||
For more details about this platform, please refer to the documentation at
|
For more details about this platform, please refer to the documentation at
|
||||||
https://home-assistant.io/components/media_player.kodi/
|
https://home-assistant.io/components/media_player.kodi/
|
||||||
"""
|
"""
|
||||||
import urllib
|
|
||||||
import logging
|
import logging
|
||||||
|
import urllib
|
||||||
|
|
||||||
from homeassistant.components.media_player import (
|
from homeassistant.components.media_player import (
|
||||||
MediaPlayerDevice, SUPPORT_PAUSE, SUPPORT_SEEK, SUPPORT_VOLUME_SET,
|
SUPPORT_NEXT_TRACK, SUPPORT_PAUSE, SUPPORT_PREVIOUS_TRACK, SUPPORT_SEEK,
|
||||||
SUPPORT_VOLUME_MUTE, SUPPORT_PREVIOUS_TRACK, SUPPORT_NEXT_TRACK)
|
SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_SET, MediaPlayerDevice)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
STATE_IDLE, STATE_PLAYING, STATE_PAUSED, STATE_OFF)
|
STATE_IDLE, STATE_OFF, STATE_PAUSED, STATE_PLAYING)
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
REQUIREMENTS = ['jsonrpc-requests==0.1']
|
REQUIREMENTS = ['jsonrpc-requests==0.1']
|
||||||
|
@ -9,15 +9,11 @@ https://home-assistant.io/components/media_player.mpd/
|
|||||||
import logging
|
import logging
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
|
|
||||||
from homeassistant.const import (
|
|
||||||
STATE_PLAYING, STATE_PAUSED, STATE_OFF)
|
|
||||||
|
|
||||||
from homeassistant.components.media_player import (
|
from homeassistant.components.media_player import (
|
||||||
MediaPlayerDevice,
|
MEDIA_TYPE_MUSIC, SUPPORT_NEXT_TRACK, SUPPORT_PAUSE,
|
||||||
SUPPORT_PAUSE, SUPPORT_VOLUME_SET, SUPPORT_TURN_OFF,
|
SUPPORT_PREVIOUS_TRACK, SUPPORT_TURN_OFF, SUPPORT_TURN_ON,
|
||||||
SUPPORT_TURN_ON, SUPPORT_PREVIOUS_TRACK, SUPPORT_NEXT_TRACK,
|
SUPPORT_VOLUME_SET, MediaPlayerDevice)
|
||||||
MEDIA_TYPE_MUSIC)
|
from homeassistant.const import STATE_OFF, STATE_PAUSED, STATE_PLAYING
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
REQUIREMENTS = ['python-mpd2==0.5.4']
|
REQUIREMENTS = ['python-mpd2==0.5.4']
|
||||||
|
@ -6,20 +6,20 @@ Provides an interface to the Plex API.
|
|||||||
For more details about this platform, please refer to the documentation at
|
For more details about this platform, please refer to the documentation at
|
||||||
https://home-assistant.io/components/media_player.plex/
|
https://home-assistant.io/components/media_player.plex/
|
||||||
"""
|
"""
|
||||||
import os
|
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
from homeassistant.loader import get_component
|
|
||||||
import homeassistant.util as util
|
import homeassistant.util as util
|
||||||
from homeassistant.components.media_player import (
|
from homeassistant.components.media_player import (
|
||||||
MediaPlayerDevice, SUPPORT_PAUSE, SUPPORT_PREVIOUS_TRACK,
|
MEDIA_TYPE_TVSHOW, MEDIA_TYPE_VIDEO, SUPPORT_NEXT_TRACK, SUPPORT_PAUSE,
|
||||||
SUPPORT_NEXT_TRACK, MEDIA_TYPE_TVSHOW, MEDIA_TYPE_VIDEO)
|
SUPPORT_PREVIOUS_TRACK, MediaPlayerDevice)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
DEVICE_DEFAULT_NAME, STATE_IDLE, STATE_PLAYING,
|
DEVICE_DEFAULT_NAME, STATE_IDLE, STATE_OFF, STATE_PAUSED, STATE_PLAYING,
|
||||||
STATE_PAUSED, STATE_OFF, STATE_UNKNOWN)
|
STATE_UNKNOWN)
|
||||||
|
from homeassistant.loader import get_component
|
||||||
|
|
||||||
REQUIREMENTS = ['plexapi==1.1.0']
|
REQUIREMENTS = ['plexapi==1.1.0']
|
||||||
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
|
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
|
||||||
|
@ -10,14 +10,11 @@ import logging
|
|||||||
import socket
|
import socket
|
||||||
|
|
||||||
from homeassistant.components.media_player import (
|
from homeassistant.components.media_player import (
|
||||||
MediaPlayerDevice, SUPPORT_PAUSE, SUPPORT_VOLUME_STEP,
|
DOMAIN, SUPPORT_NEXT_TRACK, SUPPORT_PAUSE, SUPPORT_PREVIOUS_TRACK,
|
||||||
SUPPORT_VOLUME_MUTE, SUPPORT_PREVIOUS_TRACK,
|
SUPPORT_TURN_OFF, SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_STEP,
|
||||||
SUPPORT_NEXT_TRACK, SUPPORT_TURN_OFF,
|
MediaPlayerDevice)
|
||||||
DOMAIN)
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_HOST, CONF_NAME, STATE_OFF,
|
CONF_HOST, CONF_NAME, STATE_OFF, STATE_ON, STATE_UNKNOWN)
|
||||||
STATE_ON, STATE_UNKNOWN)
|
|
||||||
|
|
||||||
from homeassistant.helpers import validate_config
|
from homeassistant.helpers import validate_config
|
||||||
|
|
||||||
CONF_PORT = "port"
|
CONF_PORT = "port"
|
||||||
|
@ -10,12 +10,9 @@ https://home-assistant.io/components/media_player.snapcast/
|
|||||||
import logging
|
import logging
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
from homeassistant.const import (
|
|
||||||
STATE_ON, STATE_OFF)
|
|
||||||
|
|
||||||
from homeassistant.components.media_player import (
|
from homeassistant.components.media_player import (
|
||||||
MediaPlayerDevice,
|
SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_SET, MediaPlayerDevice)
|
||||||
SUPPORT_VOLUME_SET, SUPPORT_VOLUME_MUTE)
|
from homeassistant.const import STATE_OFF, STATE_ON
|
||||||
|
|
||||||
SUPPORT_SNAPCAST = SUPPORT_VOLUME_SET | SUPPORT_VOLUME_MUTE
|
SUPPORT_SNAPCAST = SUPPORT_VOLUME_SET | SUPPORT_VOLUME_MUTE
|
||||||
DOMAIN = 'snapcast'
|
DOMAIN = 'snapcast'
|
||||||
|
@ -6,17 +6,15 @@ Provides an interface to Sonos players (via SoCo)
|
|||||||
For more details about this platform, please refer to the documentation at
|
For more details about this platform, please refer to the documentation at
|
||||||
https://home-assistant.io/components/media_player.sonos/
|
https://home-assistant.io/components/media_player.sonos/
|
||||||
"""
|
"""
|
||||||
import logging
|
|
||||||
import datetime
|
import datetime
|
||||||
|
import logging
|
||||||
|
|
||||||
from homeassistant.components.media_player import (
|
from homeassistant.components.media_player import (
|
||||||
MediaPlayerDevice, SUPPORT_PAUSE, SUPPORT_SEEK, SUPPORT_VOLUME_SET,
|
MEDIA_TYPE_MUSIC, SUPPORT_NEXT_TRACK, SUPPORT_PAUSE,
|
||||||
SUPPORT_VOLUME_MUTE, SUPPORT_PREVIOUS_TRACK, SUPPORT_NEXT_TRACK,
|
SUPPORT_PREVIOUS_TRACK, SUPPORT_SEEK, SUPPORT_VOLUME_MUTE,
|
||||||
MEDIA_TYPE_MUSIC)
|
SUPPORT_VOLUME_SET, MediaPlayerDevice)
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
STATE_IDLE, STATE_PLAYING, STATE_PAUSED, STATE_UNKNOWN)
|
STATE_IDLE, STATE_PAUSED, STATE_PLAYING, STATE_UNKNOWN)
|
||||||
|
|
||||||
|
|
||||||
REQUIREMENTS = ['SoCo==0.11.1']
|
REQUIREMENTS = ['SoCo==0.11.1']
|
||||||
|
|
||||||
|
@ -11,14 +11,12 @@ import telnetlib
|
|||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
|
||||||
from homeassistant.components.media_player import (
|
from homeassistant.components.media_player import (
|
||||||
MediaPlayerDevice, SUPPORT_PAUSE, SUPPORT_SEEK, SUPPORT_VOLUME_SET,
|
DOMAIN, MEDIA_TYPE_MUSIC, SUPPORT_NEXT_TRACK, SUPPORT_PAUSE,
|
||||||
SUPPORT_VOLUME_MUTE, SUPPORT_PREVIOUS_TRACK, SUPPORT_NEXT_TRACK,
|
SUPPORT_PREVIOUS_TRACK, SUPPORT_SEEK, SUPPORT_TURN_OFF, SUPPORT_TURN_ON,
|
||||||
SUPPORT_TURN_ON, SUPPORT_TURN_OFF,
|
SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_SET, MediaPlayerDevice)
|
||||||
MEDIA_TYPE_MUSIC, DOMAIN)
|
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_HOST, CONF_USERNAME, CONF_PASSWORD,
|
CONF_HOST, CONF_PASSWORD, CONF_USERNAME, STATE_IDLE, STATE_OFF,
|
||||||
STATE_IDLE, STATE_PLAYING, STATE_PAUSED, STATE_OFF, STATE_UNKNOWN)
|
STATE_PAUSED, STATE_PLAYING, STATE_UNKNOWN)
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -7,34 +7,28 @@ For more details about this platform, please refer to the documentation at
|
|||||||
https://home-assistant.io/components/media_player.universal/
|
https://home-assistant.io/components/media_player.universal/
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import logging
|
||||||
# pylint: disable=import-error
|
# pylint: disable=import-error
|
||||||
from copy import copy
|
from copy import copy
|
||||||
import logging
|
|
||||||
|
|
||||||
from homeassistant.helpers.event import track_state_change
|
|
||||||
from homeassistant.helpers.service import call_from_config
|
|
||||||
|
|
||||||
from homeassistant.const import (
|
|
||||||
STATE_IDLE, STATE_ON, STATE_OFF, CONF_NAME,
|
|
||||||
ATTR_ENTITY_ID, ATTR_ENTITY_PICTURE,
|
|
||||||
SERVICE_TURN_OFF, SERVICE_TURN_ON,
|
|
||||||
SERVICE_VOLUME_UP, SERVICE_VOLUME_DOWN, SERVICE_VOLUME_SET,
|
|
||||||
SERVICE_VOLUME_MUTE,
|
|
||||||
SERVICE_MEDIA_PLAY_PAUSE, SERVICE_MEDIA_PLAY, SERVICE_MEDIA_PAUSE,
|
|
||||||
SERVICE_MEDIA_NEXT_TRACK, SERVICE_MEDIA_PREVIOUS_TRACK, SERVICE_MEDIA_SEEK)
|
|
||||||
|
|
||||||
from homeassistant.components.media_player import (
|
from homeassistant.components.media_player import (
|
||||||
MediaPlayerDevice, DOMAIN,
|
ATTR_APP_ID, ATTR_APP_NAME, ATTR_MEDIA_ALBUM_ARTIST, ATTR_MEDIA_ALBUM_NAME,
|
||||||
SUPPORT_VOLUME_STEP, SUPPORT_VOLUME_SET, SUPPORT_VOLUME_MUTE,
|
ATTR_MEDIA_ARTIST, ATTR_MEDIA_CHANNEL, ATTR_MEDIA_CONTENT_ID,
|
||||||
SUPPORT_TURN_ON, SUPPORT_TURN_OFF,
|
ATTR_MEDIA_CONTENT_TYPE, ATTR_MEDIA_DURATION, ATTR_MEDIA_EPISODE,
|
||||||
SERVICE_PLAY_MEDIA,
|
ATTR_MEDIA_PLAYLIST, ATTR_MEDIA_SEASON, ATTR_MEDIA_SEEK_POSITION,
|
||||||
ATTR_SUPPORTED_MEDIA_COMMANDS, ATTR_MEDIA_VOLUME_MUTED,
|
ATTR_MEDIA_SERIES_TITLE, ATTR_MEDIA_TITLE, ATTR_MEDIA_TRACK,
|
||||||
ATTR_MEDIA_CONTENT_ID, ATTR_MEDIA_CONTENT_TYPE, ATTR_MEDIA_DURATION,
|
ATTR_MEDIA_VOLUME_LEVEL, ATTR_MEDIA_VOLUME_MUTED,
|
||||||
ATTR_MEDIA_TITLE, ATTR_MEDIA_ARTIST, ATTR_MEDIA_ALBUM_NAME,
|
ATTR_SUPPORTED_MEDIA_COMMANDS, DOMAIN, SERVICE_PLAY_MEDIA,
|
||||||
ATTR_MEDIA_TRACK, ATTR_MEDIA_SERIES_TITLE, ATTR_MEDIA_ALBUM_ARTIST,
|
SUPPORT_TURN_OFF, SUPPORT_TURN_ON, SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_SET,
|
||||||
ATTR_MEDIA_SEASON, ATTR_MEDIA_EPISODE, ATTR_MEDIA_CHANNEL,
|
SUPPORT_VOLUME_STEP, MediaPlayerDevice)
|
||||||
ATTR_MEDIA_PLAYLIST, ATTR_APP_ID, ATTR_APP_NAME, ATTR_MEDIA_VOLUME_LEVEL,
|
from homeassistant.const import (
|
||||||
ATTR_MEDIA_SEEK_POSITION)
|
ATTR_ENTITY_ID, ATTR_ENTITY_PICTURE, CONF_NAME, SERVICE_MEDIA_NEXT_TRACK,
|
||||||
|
SERVICE_MEDIA_PAUSE, SERVICE_MEDIA_PLAY, SERVICE_MEDIA_PLAY_PAUSE,
|
||||||
|
SERVICE_MEDIA_PREVIOUS_TRACK, SERVICE_MEDIA_SEEK, SERVICE_TURN_OFF,
|
||||||
|
SERVICE_TURN_ON, SERVICE_VOLUME_DOWN, SERVICE_VOLUME_MUTE,
|
||||||
|
SERVICE_VOLUME_SET, SERVICE_VOLUME_UP, STATE_IDLE, STATE_OFF, STATE_ON)
|
||||||
|
from homeassistant.helpers.event import track_state_change
|
||||||
|
from homeassistant.helpers.service import call_from_config
|
||||||
|
|
||||||
ATTR_ACTIVE_CHILD = 'active_child'
|
ATTR_ACTIVE_CHILD = 'active_child'
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@ https://home-assistant.io/components/modbus/
|
|||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.const import (EVENT_HOMEASSISTANT_START,
|
from homeassistant.const import (
|
||||||
EVENT_HOMEASSISTANT_STOP)
|
EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP)
|
||||||
|
|
||||||
DOMAIN = "modbus"
|
DOMAIN = "modbus"
|
||||||
|
|
||||||
|
@ -7,18 +7,14 @@ For more details about this component, please refer to the documentation at
|
|||||||
https://home-assistant.io/components/mqtt_eventstream.html
|
https://home-assistant.io/components/mqtt_eventstream.html
|
||||||
"""
|
"""
|
||||||
import json
|
import json
|
||||||
from homeassistant.core import EventOrigin, State
|
|
||||||
|
import homeassistant.loader as loader
|
||||||
from homeassistant.components.mqtt import DOMAIN as MQTT_DOMAIN
|
from homeassistant.components.mqtt import DOMAIN as MQTT_DOMAIN
|
||||||
from homeassistant.components.mqtt import SERVICE_PUBLISH as MQTT_SVC_PUBLISH
|
from homeassistant.components.mqtt import SERVICE_PUBLISH as MQTT_SVC_PUBLISH
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_SERVICE_DATA,
|
ATTR_SERVICE_DATA, EVENT_CALL_SERVICE, EVENT_SERVICE_EXECUTED,
|
||||||
MATCH_ALL,
|
EVENT_STATE_CHANGED, EVENT_TIME_CHANGED, MATCH_ALL)
|
||||||
EVENT_TIME_CHANGED,
|
from homeassistant.core import EventOrigin, State
|
||||||
EVENT_CALL_SERVICE,
|
|
||||||
EVENT_SERVICE_EXECUTED,
|
|
||||||
EVENT_STATE_CHANGED,
|
|
||||||
)
|
|
||||||
import homeassistant.loader as loader
|
|
||||||
from homeassistant.remote import JSONEncoder
|
from homeassistant.remote import JSONEncoder
|
||||||
|
|
||||||
# The domain of your component. Should be equal to the name of your component
|
# The domain of your component. Should be equal to the name of your component
|
||||||
|
@ -10,14 +10,11 @@ https://home-assistant.io/components/sensor.mysensors/
|
|||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.helpers import validate_config
|
|
||||||
import homeassistant.bootstrap as bootstrap
|
import homeassistant.bootstrap as bootstrap
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
EVENT_HOMEASSISTANT_START,
|
ATTR_DISCOVERED, ATTR_SERVICE, EVENT_HOMEASSISTANT_START,
|
||||||
EVENT_HOMEASSISTANT_STOP,
|
EVENT_HOMEASSISTANT_STOP, EVENT_PLATFORM_DISCOVERED, TEMP_CELCIUS)
|
||||||
EVENT_PLATFORM_DISCOVERED, ATTR_SERVICE, ATTR_DISCOVERED,
|
from homeassistant.helpers import validate_config
|
||||||
TEMP_CELCIUS,)
|
|
||||||
|
|
||||||
CONF_GATEWAYS = 'gateways'
|
CONF_GATEWAYS = 'gateways'
|
||||||
CONF_PORT = 'port'
|
CONF_PORT = 'port'
|
||||||
|
@ -8,7 +8,7 @@ https://home-assistant.io/components/thermostat.nest/
|
|||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.const import (CONF_USERNAME, CONF_PASSWORD)
|
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
||||||
|
|
||||||
REQUIREMENTS = ['python-nest==2.6.0']
|
REQUIREMENTS = ['python-nest==2.6.0']
|
||||||
DOMAIN = 'nest'
|
DOMAIN = 'nest'
|
||||||
|
@ -6,7 +6,6 @@ Demo notification service.
|
|||||||
"""
|
"""
|
||||||
from homeassistant.components.notify import ATTR_TITLE, BaseNotificationService
|
from homeassistant.components.notify import ATTR_TITLE, BaseNotificationService
|
||||||
|
|
||||||
|
|
||||||
EVENT_NOTIFY = "notify"
|
EVENT_NOTIFY = "notify"
|
||||||
|
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user