Spelling fixes (#12041)
* Spelling fixes *Lots* of them. * Spelling breaking changes * Fix lint errors
This commit is contained in:
parent
38fd9b65bf
commit
8dcfd35b8b
138 changed files with 285 additions and 286 deletions
|
@ -51,8 +51,8 @@ class _DisplayCategory(object):
|
||||||
|
|
||||||
# Describes a combination of devices set to a specific state, when the
|
# Describes a combination of devices set to a specific state, when the
|
||||||
# state change must occur in a specific order. For example, a "watch
|
# state change must occur in a specific order. For example, a "watch
|
||||||
# Neflix" scene might require the: 1. TV to be powered on & 2. Input set to
|
# Netflix" scene might require the: 1. TV to be powered on & 2. Input set
|
||||||
# HDMI1. Applies to Scenes
|
# to HDMI1. Applies to Scenes
|
||||||
ACTIVITY_TRIGGER = "ACTIVITY_TRIGGER"
|
ACTIVITY_TRIGGER = "ACTIVITY_TRIGGER"
|
||||||
|
|
||||||
# Indicates media devices with video or photo capabilities.
|
# Indicates media devices with video or photo capabilities.
|
||||||
|
@ -667,7 +667,7 @@ def api_message(request,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# If a correlation token exsits, add it to header / Need by Async requests
|
# If a correlation token exists, add it to header / Need by Async requests
|
||||||
token = request[API_HEADER].get('correlationToken')
|
token = request[API_HEADER].get('correlationToken')
|
||||||
if token:
|
if token:
|
||||||
response[API_EVENT][API_HEADER]['correlationToken'] = token
|
response[API_EVENT][API_HEADER]['correlationToken'] = token
|
||||||
|
|
|
@ -251,7 +251,7 @@ class AndroidIPCamEntity(Entity):
|
||||||
"""The Android device running IP Webcam."""
|
"""The Android device running IP Webcam."""
|
||||||
|
|
||||||
def __init__(self, host, ipcam):
|
def __init__(self, host, ipcam):
|
||||||
"""Initialize the data oject."""
|
"""Initialize the data object."""
|
||||||
self._host = host
|
self._host = host
|
||||||
self._ipcam = ipcam
|
self._ipcam = ipcam
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ class APCUPSdData(object):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, host, port):
|
def __init__(self, host, port):
|
||||||
"""Initialize the data oject."""
|
"""Initialize the data object."""
|
||||||
from apcaccess import status
|
from apcaccess import status
|
||||||
self._host = host
|
self._host = host
|
||||||
self._port = port
|
self._port = port
|
||||||
|
|
|
@ -47,7 +47,7 @@ def setup(hass, config):
|
||||||
return False
|
return False
|
||||||
hass.data[DATA_ARLO] = arlo
|
hass.data[DATA_ARLO] = arlo
|
||||||
except (ConnectTimeout, HTTPError) as ex:
|
except (ConnectTimeout, HTTPError) as ex:
|
||||||
_LOGGER.error("Unable to connect to Netgar Arlo: %s", str(ex))
|
_LOGGER.error("Unable to connect to Netgear Arlo: %s", str(ex))
|
||||||
hass.components.persistent_notification.create(
|
hass.components.persistent_notification.create(
|
||||||
'Error: {}<br />'
|
'Error: {}<br />'
|
||||||
'You will need to restart hass after fixing.'
|
'You will need to restart hass after fixing.'
|
||||||
|
|
|
@ -48,7 +48,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||||
"""Set up the FFmpeg binary moition sensor."""
|
"""Set up the FFmpeg binary motion sensor."""
|
||||||
manager = hass.data[DATA_FFMPEG]
|
manager = hass.data[DATA_FFMPEG]
|
||||||
|
|
||||||
if not manager.async_run_test(config.get(CONF_INPUT)):
|
if not manager.async_run_test(config.get(CONF_INPUT)):
|
||||||
|
|
|
@ -118,7 +118,7 @@ class HikvisionData(object):
|
||||||
"""Hikvision device event stream object."""
|
"""Hikvision device event stream object."""
|
||||||
|
|
||||||
def __init__(self, hass, url, port, name, username, password):
|
def __init__(self, hass, url, port, name, username, password):
|
||||||
"""Initialize the data oject."""
|
"""Initialize the data object."""
|
||||||
from pyhik.hikvision import HikCamera
|
from pyhik.hikvision import HikCamera
|
||||||
self._url = url
|
self._url = url
|
||||||
self._port = port
|
self._port = port
|
||||||
|
|
|
@ -67,8 +67,8 @@ def setup_platform(hass, config: ConfigType,
|
||||||
elif subnode_id == 2:
|
elif subnode_id == 2:
|
||||||
parent_device.add_negative_node(node)
|
parent_device.add_negative_node(node)
|
||||||
elif device_type == 'moisture':
|
elif device_type == 'moisture':
|
||||||
# Moisure nodes have a subnode 2, but we ignore it because it's
|
# Moisture nodes have a subnode 2, but we ignore it because
|
||||||
# just the inverse of the primary node.
|
# it's just the inverse of the primary node.
|
||||||
if subnode_id == 4:
|
if subnode_id == 4:
|
||||||
# Heartbeat node
|
# Heartbeat node
|
||||||
device = ISYBinarySensorHeartbeat(node, parent_device)
|
device = ISYBinarySensorHeartbeat(node, parent_device)
|
||||||
|
|
|
@ -97,7 +97,7 @@ class PilightBinarySensor(BinarySensorDevice):
|
||||||
def _handle_code(self, call):
|
def _handle_code(self, call):
|
||||||
"""Handle received code by the pilight-daemon.
|
"""Handle received code by the pilight-daemon.
|
||||||
|
|
||||||
If the code matches the defined playload
|
If the code matches the defined payload
|
||||||
of this sensor the sensor state is changed accordingly.
|
of this sensor the sensor state is changed accordingly.
|
||||||
"""
|
"""
|
||||||
# Check if received code matches defined playoad
|
# Check if received code matches defined playoad
|
||||||
|
@ -162,10 +162,10 @@ class PilightTriggerSensor(BinarySensorDevice):
|
||||||
def _handle_code(self, call):
|
def _handle_code(self, call):
|
||||||
"""Handle received code by the pilight-daemon.
|
"""Handle received code by the pilight-daemon.
|
||||||
|
|
||||||
If the code matches the defined playload
|
If the code matches the defined payload
|
||||||
of this sensor the sensor state is changed accordingly.
|
of this sensor the sensor state is changed accordingly.
|
||||||
"""
|
"""
|
||||||
# Check if received code matches defined playoad
|
# Check if received code matches defined payload
|
||||||
# True if payload is contained in received code dict
|
# True if payload is contained in received code dict
|
||||||
payload_ok = True
|
payload_ok = True
|
||||||
for key in self._payload:
|
for key in self._payload:
|
||||||
|
|
|
@ -22,7 +22,7 @@ MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=90)
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def setup_platform(hass, config, add_devices, discoveryy_info=None):
|
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
"""Set up Abode camera devices."""
|
"""Set up Abode camera devices."""
|
||||||
import abodepy.helpers.constants as CONST
|
import abodepy.helpers.constants as CONST
|
||||||
import abodepy.helpers.timeline as TIMELINE
|
import abodepy.helpers.timeline as TIMELINE
|
||||||
|
|
|
@ -28,7 +28,7 @@ CONF_VERTICAL_FLIP = 'vertical_flip'
|
||||||
|
|
||||||
DEFAULT_HORIZONTAL_FLIP = 0
|
DEFAULT_HORIZONTAL_FLIP = 0
|
||||||
DEFAULT_IMAGE_HEIGHT = 480
|
DEFAULT_IMAGE_HEIGHT = 480
|
||||||
DEFAULT_IMAGE_QUALITIY = 7
|
DEFAULT_IMAGE_QUALITY = 7
|
||||||
DEFAULT_IMAGE_ROTATION = 0
|
DEFAULT_IMAGE_ROTATION = 0
|
||||||
DEFAULT_IMAGE_WIDTH = 640
|
DEFAULT_IMAGE_WIDTH = 640
|
||||||
DEFAULT_NAME = 'Raspberry Pi Camera'
|
DEFAULT_NAME = 'Raspberry Pi Camera'
|
||||||
|
@ -41,7 +41,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||||
vol.All(vol.Coerce(int), vol.Range(min=0, max=1)),
|
vol.All(vol.Coerce(int), vol.Range(min=0, max=1)),
|
||||||
vol.Optional(CONF_IMAGE_HEIGHT, default=DEFAULT_IMAGE_HEIGHT):
|
vol.Optional(CONF_IMAGE_HEIGHT, default=DEFAULT_IMAGE_HEIGHT):
|
||||||
vol.Coerce(int),
|
vol.Coerce(int),
|
||||||
vol.Optional(CONF_IMAGE_QUALITY, default=DEFAULT_IMAGE_QUALITIY):
|
vol.Optional(CONF_IMAGE_QUALITY, default=DEFAULT_IMAGE_QUALITY):
|
||||||
vol.All(vol.Coerce(int), vol.Range(min=0, max=100)),
|
vol.All(vol.Coerce(int), vol.Range(min=0, max=100)),
|
||||||
vol.Optional(CONF_IMAGE_ROTATION, default=DEFAULT_IMAGE_ROTATION):
|
vol.Optional(CONF_IMAGE_ROTATION, default=DEFAULT_IMAGE_ROTATION):
|
||||||
vol.All(vol.Coerce(int), vol.Range(min=0, max=359)),
|
vol.All(vol.Coerce(int), vol.Range(min=0, max=359)),
|
||||||
|
@ -131,7 +131,7 @@ class RaspberryCamera(Camera):
|
||||||
stderr=subprocess.STDOUT)
|
stderr=subprocess.STDOUT)
|
||||||
|
|
||||||
def camera_image(self):
|
def camera_image(self):
|
||||||
"""Return raspstill image response."""
|
"""Return raspistill image response."""
|
||||||
with open(self._config[CONF_FILE_PATH], 'rb') as file:
|
with open(self._config[CONF_FILE_PATH], 'rb') as file:
|
||||||
return file.read()
|
return file.read()
|
||||||
|
|
||||||
|
|
|
@ -249,7 +249,7 @@ class GenericThermostat(ClimateDevice):
|
||||||
else:
|
else:
|
||||||
_LOGGER.error("Unrecognized operation mode: %s", operation_mode)
|
_LOGGER.error("Unrecognized operation mode: %s", operation_mode)
|
||||||
return
|
return
|
||||||
# Ensure we updae the current operation after changing the mode
|
# Ensure we update the current operation after changing the mode
|
||||||
self.schedule_update_ha_state()
|
self.schedule_update_ha_state()
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
|
|
|
@ -139,8 +139,7 @@ class MySensorsHVAC(mysensors.MySensorsEntity, ClimateDevice):
|
||||||
self.gateway.set_child_value(
|
self.gateway.set_child_value(
|
||||||
self.node_id, self.child_id, value_type, value)
|
self.node_id, self.child_id, value_type, value)
|
||||||
if self.gateway.optimistic:
|
if self.gateway.optimistic:
|
||||||
# O
|
# Optimistically assume that device has changed state
|
||||||
# ptimistically assume that device has changed state
|
|
||||||
self._values[value_type] = value
|
self._values[value_type] = value
|
||||||
self.schedule_update_ha_state()
|
self.schedule_update_ha_state()
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ CONF_RELAY = 'relay'
|
||||||
CONF_THERMOSTAT = 'thermostat'
|
CONF_THERMOSTAT = 'thermostat'
|
||||||
|
|
||||||
DEFAULT_AWAY_TEMPERATURE = 14
|
DEFAULT_AWAY_TEMPERATURE = 14
|
||||||
# # The default offeset is 2 hours (when you use the thermostat itself)
|
# # The default offset is 2 hours (when you use the thermostat itself)
|
||||||
DEFAULT_TIME_OFFSET = 7200
|
DEFAULT_TIME_OFFSET = 7200
|
||||||
# # Return cached results if last scan was less then this time ago
|
# # Return cached results if last scan was less then this time ago
|
||||||
# # NetAtmo Data is uploaded to server every hour
|
# # NetAtmo Data is uploaded to server every hour
|
||||||
|
|
|
@ -59,7 +59,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
|
|
||||||
|
|
||||||
class ThermostatDevice(ClimateDevice):
|
class ThermostatDevice(ClimateDevice):
|
||||||
"""Interface class for the oemthermostat modul."""
|
"""Interface class for the oemthermostat module."""
|
||||||
|
|
||||||
def __init__(self, hass, thermostat, name, away_temp):
|
def __init__(self, hass, thermostat, name, away_temp):
|
||||||
"""Initialize the device."""
|
"""Initialize the device."""
|
||||||
|
|
|
@ -68,7 +68,7 @@ class HMCover(HMDevice, CoverDevice):
|
||||||
self._hmdevice.stop(self._channel)
|
self._hmdevice.stop(self._channel)
|
||||||
|
|
||||||
def _init_data_struct(self):
|
def _init_data_struct(self):
|
||||||
"""Generate a data dictoinary (self._data) from metadata."""
|
"""Generate a data dictionary (self._data) from metadata."""
|
||||||
self._state = "LEVEL"
|
self._state = "LEVEL"
|
||||||
self._data.update({self._state: STATE_UNKNOWN})
|
self._data.update({self._state: STATE_UNKNOWN})
|
||||||
if "LEVEL_2" in self._hmdevice.WRITENODE:
|
if "LEVEL_2" in self._hmdevice.WRITENODE:
|
||||||
|
|
|
@ -74,7 +74,7 @@ def async_add_devices_discovery(hass, discovery_info, async_add_devices):
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def async_add_devices_config(hass, config, async_add_devices):
|
def async_add_devices_config(hass, config, async_add_devices):
|
||||||
"""Set up cover for KNX platform configured within plattform."""
|
"""Set up cover for KNX platform configured within platform."""
|
||||||
import xknx
|
import xknx
|
||||||
cover = xknx.devices.Cover(
|
cover = xknx.devices.Cover(
|
||||||
hass.data[DATA_KNX].xknx,
|
hass.data[DATA_KNX].xknx,
|
||||||
|
|
|
@ -63,7 +63,7 @@ class LutronCover(LutronDevice, CoverDevice):
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
"""Call when forcing a refresh of the device."""
|
"""Call when forcing a refresh of the device."""
|
||||||
# Reading the property (rather than last_level()) fetchs value
|
# Reading the property (rather than last_level()) fetches value
|
||||||
level = self._lutron_device.level
|
level = self._lutron_device.level
|
||||||
_LOGGER.debug("Lutron ID: %d updated to %f",
|
_LOGGER.debug("Lutron ID: %d updated to %f",
|
||||||
self._lutron_device.id, level)
|
self._lutron_device.id, level)
|
||||||
|
|
|
@ -242,7 +242,7 @@ class _Connection:
|
||||||
return self._connected
|
return self._connected
|
||||||
|
|
||||||
def connect(self):
|
def connect(self):
|
||||||
"""Mark currenct connection state as connected."""
|
"""Mark current connection state as connected."""
|
||||||
self._connected = True
|
self._connected = True
|
||||||
|
|
||||||
def disconnect(self):
|
def disconnect(self):
|
||||||
|
|
|
@ -119,7 +119,7 @@ class HuaweiDeviceScanner(DeviceScanner):
|
||||||
cnt = requests.post('http://{}/asp/GetRandCount.asp'.format(self.host))
|
cnt = requests.post('http://{}/asp/GetRandCount.asp'.format(self.host))
|
||||||
cnt_str = str(cnt.content, cnt.apparent_encoding, errors='replace')
|
cnt_str = str(cnt.content, cnt.apparent_encoding, errors='replace')
|
||||||
|
|
||||||
_LOGGER.debug("Loggin in")
|
_LOGGER.debug("Logging in")
|
||||||
cookie = requests.post('http://{}/login.cgi'.format(self.host),
|
cookie = requests.post('http://{}/login.cgi'.format(self.host),
|
||||||
data=[('UserName', self.username),
|
data=[('UserName', self.username),
|
||||||
('PassWord', self.password),
|
('PassWord', self.password),
|
||||||
|
|
|
@ -46,8 +46,8 @@ def get_scanner(hass, config):
|
||||||
return scanner if scanner.success_init else None
|
return scanner if scanner.success_init else None
|
||||||
|
|
||||||
|
|
||||||
def _refresh_on_acccess_denied(func):
|
def _refresh_on_access_denied(func):
|
||||||
"""If remove rebooted, it lost our session so rebuld one and try again."""
|
"""If remove rebooted, it lost our session so rebuild one and try again."""
|
||||||
def decorator(self, *args, **kwargs):
|
def decorator(self, *args, **kwargs):
|
||||||
"""Wrap the function to refresh session_id on PermissionError."""
|
"""Wrap the function to refresh session_id on PermissionError."""
|
||||||
try:
|
try:
|
||||||
|
@ -95,7 +95,7 @@ class UbusDeviceScanner(DeviceScanner):
|
||||||
"""Must be implemented depending on the software."""
|
"""Must be implemented depending on the software."""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
@_refresh_on_acccess_denied
|
@_refresh_on_access_denied
|
||||||
def get_device_name(self, mac):
|
def get_device_name(self, mac):
|
||||||
"""Return the name of the given device or None if we don't know."""
|
"""Return the name of the given device or None if we don't know."""
|
||||||
if self.mac2name is None:
|
if self.mac2name is None:
|
||||||
|
@ -104,7 +104,7 @@ class UbusDeviceScanner(DeviceScanner):
|
||||||
self.mac2name = None
|
self.mac2name = None
|
||||||
return name
|
return name
|
||||||
|
|
||||||
@_refresh_on_acccess_denied
|
@_refresh_on_access_denied
|
||||||
def _update_info(self):
|
def _update_info(self):
|
||||||
"""Ensure the information from the router is up to date.
|
"""Ensure the information from the router is up to date.
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
"""
|
"""
|
||||||
Support for Dominos Pizza ordering.
|
Support for Dominos Pizza ordering.
|
||||||
|
|
||||||
The Dominos Pizza component ceates a service which can be invoked to order
|
The Dominos Pizza component creates a service which can be invoked to order
|
||||||
from their menu
|
from their menu
|
||||||
|
|
||||||
For more details about this platform, please refer to the documentation at
|
For more details about this platform, please refer to the documentation at
|
||||||
|
|
|
@ -79,7 +79,7 @@ def setup(hass, config):
|
||||||
|
|
||||||
if req.status_code != 200:
|
if req.status_code != 200:
|
||||||
_LOGGER.warning(
|
_LOGGER.warning(
|
||||||
"downloading '%s' failed, stauts_code=%d",
|
"downloading '%s' failed, status_code=%d",
|
||||||
url,
|
url,
|
||||||
req.status_code)
|
req.status_code)
|
||||||
|
|
||||||
|
|
|
@ -193,7 +193,7 @@ class EightSleepUserEntity(Entity):
|
||||||
"""The Eight Sleep device entity."""
|
"""The Eight Sleep device entity."""
|
||||||
|
|
||||||
def __init__(self, eight):
|
def __init__(self, eight):
|
||||||
"""Initialize the data oject."""
|
"""Initialize the data object."""
|
||||||
self._eight = eight
|
self._eight = eight
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
|
@ -217,7 +217,7 @@ class EightSleepHeatEntity(Entity):
|
||||||
"""The Eight Sleep device entity."""
|
"""The Eight Sleep device entity."""
|
||||||
|
|
||||||
def __init__(self, eight):
|
def __init__(self, eight):
|
||||||
"""Initialize the data oject."""
|
"""Initialize the data object."""
|
||||||
self._eight = eight
|
self._eight = eight
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
|
|
|
@ -205,7 +205,7 @@ def async_setup(hass, config: dict):
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def async_handle_fan_service(service):
|
def async_handle_fan_service(service):
|
||||||
"""Hande service call for fans."""
|
"""Handle service call for fans."""
|
||||||
method = SERVICE_TO_METHOD.get(service.service)
|
method = SERVICE_TO_METHOD.get(service.service)
|
||||||
params = service.data.copy()
|
params = service.data.copy()
|
||||||
|
|
||||||
|
|
|
@ -586,9 +586,9 @@ def _is_latest(js_option, request):
|
||||||
|
|
||||||
family_min_version = {
|
family_min_version = {
|
||||||
'Chrome': 50, # Probably can reduce this
|
'Chrome': 50, # Probably can reduce this
|
||||||
'Firefox': 43, # Array.protopype.includes added in 43
|
'Firefox': 43, # Array.prototype.includes added in 43
|
||||||
'Opera': 40, # Probably can reduce this
|
'Opera': 40, # Probably can reduce this
|
||||||
'Edge': 14, # Array.protopype.includes added in 14
|
'Edge': 14, # Array.prototype.includes added in 14
|
||||||
'Safari': 10, # many features not supported by 9
|
'Safari': 10, # many features not supported by 9
|
||||||
}
|
}
|
||||||
version = family_min_version.get(useragent.browser.family)
|
version = family_min_version.get(useragent.browser.family)
|
||||||
|
|
|
@ -128,7 +128,7 @@ def do_authentication(hass, config):
|
||||||
"""Keep trying to validate the user_code until it expires."""
|
"""Keep trying to validate the user_code until it expires."""
|
||||||
if now >= dt.as_local(dev_flow.user_code_expiry):
|
if now >= dt.as_local(dev_flow.user_code_expiry):
|
||||||
hass.components.persistent_notification.create(
|
hass.components.persistent_notification.create(
|
||||||
'Authenication code expired, please restart '
|
'Authentication code expired, please restart '
|
||||||
'Home-Assistant and try again',
|
'Home-Assistant and try again',
|
||||||
title=NOTIFICATION_TITLE,
|
title=NOTIFICATION_TITLE,
|
||||||
notification_id=NOTIFICATION_ID)
|
notification_id=NOTIFICATION_ID)
|
||||||
|
|
|
@ -429,7 +429,7 @@ def async_devices_query(hass, config, payload):
|
||||||
devices = {}
|
devices = {}
|
||||||
for device in payload.get('devices', []):
|
for device in payload.get('devices', []):
|
||||||
devid = device.get('id')
|
devid = device.get('id')
|
||||||
# In theory this should never happpen
|
# In theory this should never happen
|
||||||
if not devid:
|
if not devid:
|
||||||
_LOGGER.error('Device missing ID: %s', device)
|
_LOGGER.error('Device missing ID: %s', device)
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -247,7 +247,7 @@ def get_entity_ids(hass, entity_id, domain_filter=None):
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def async_setup(hass, config):
|
def async_setup(hass, config):
|
||||||
"""Set up all groups found definded in the configuration."""
|
"""Set up all groups found defined in the configuration."""
|
||||||
component = hass.data.get(DOMAIN)
|
component = hass.data.get(DOMAIN)
|
||||||
|
|
||||||
if component is None:
|
if component is None:
|
||||||
|
|
|
@ -218,7 +218,7 @@ SCHEMA_SERVICE_SET_INSTALL_MODE = vol.Schema({
|
||||||
|
|
||||||
@bind_hass
|
@bind_hass
|
||||||
def virtualkey(hass, address, channel, param, interface=None):
|
def virtualkey(hass, address, channel, param, interface=None):
|
||||||
"""Send virtual keypress to homematic controlller."""
|
"""Send virtual keypress to homematic controller."""
|
||||||
data = {
|
data = {
|
||||||
ATTR_ADDRESS: address,
|
ATTR_ADDRESS: address,
|
||||||
ATTR_CHANNEL: channel,
|
ATTR_CHANNEL: channel,
|
||||||
|
@ -256,7 +256,7 @@ def set_device_value(hass, address, channel, param, value, interface=None):
|
||||||
|
|
||||||
@bind_hass
|
@bind_hass
|
||||||
def set_install_mode(hass, interface, mode=None, time=None, address=None):
|
def set_install_mode(hass, interface, mode=None, time=None, address=None):
|
||||||
"""Call setInstallMode XML-RPC method of supplied inteface."""
|
"""Call setInstallMode XML-RPC method of supplied interface."""
|
||||||
data = {
|
data = {
|
||||||
key: value for key, value in (
|
key: value for key, value in (
|
||||||
(ATTR_INTERFACE, interface),
|
(ATTR_INTERFACE, interface),
|
||||||
|
@ -665,7 +665,7 @@ class HMHub(Entity):
|
||||||
self.schedule_update_ha_state()
|
self.schedule_update_ha_state()
|
||||||
|
|
||||||
def _update_variables(self, now):
|
def _update_variables(self, now):
|
||||||
"""Retrive all variable data and update hmvariable states."""
|
"""Retrieve all variable data and update hmvariable states."""
|
||||||
variables = self._homematic.getAllSystemVariables(self._name)
|
variables = self._homematic.getAllSystemVariables(self._name)
|
||||||
if variables is None:
|
if variables is None:
|
||||||
return
|
return
|
||||||
|
|
|
@ -36,7 +36,7 @@ def validate_attributes(list_attributes):
|
||||||
"""Validate face attributes."""
|
"""Validate face attributes."""
|
||||||
for attr in list_attributes:
|
for attr in list_attributes:
|
||||||
if attr not in SUPPORTED_ATTRIBUTES:
|
if attr not in SUPPORTED_ATTRIBUTES:
|
||||||
raise vol.Invalid("Invalid attribtue {0}".format(attr))
|
raise vol.Invalid("Invalid attribute {0}".format(attr))
|
||||||
return list_attributes
|
return list_attributes
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -201,7 +201,7 @@ class MicrosoftFaceIdentifyEntity(ImageProcessingFaceEntity):
|
||||||
return
|
return
|
||||||
|
|
||||||
# Parse data
|
# Parse data
|
||||||
knwon_faces = []
|
known_faces = []
|
||||||
total = 0
|
total = 0
|
||||||
for face in detect:
|
for face in detect:
|
||||||
total += 1
|
total += 1
|
||||||
|
@ -215,9 +215,9 @@ class MicrosoftFaceIdentifyEntity(ImageProcessingFaceEntity):
|
||||||
name = s_name
|
name = s_name
|
||||||
break
|
break
|
||||||
|
|
||||||
knwon_faces.append({
|
known_faces.append({
|
||||||
ATTR_NAME: name,
|
ATTR_NAME: name,
|
||||||
ATTR_CONFIDENCE: data['confidence'] * 100,
|
ATTR_CONFIDENCE: data['confidence'] * 100,
|
||||||
})
|
})
|
||||||
|
|
||||||
self.async_process_faces(knwon_faces, total)
|
self.async_process_faces(known_faces, total)
|
||||||
|
|
|
@ -66,7 +66,7 @@ class ImageProcessingSsocr(ImageProcessingEntity):
|
||||||
if name:
|
if name:
|
||||||
self._name = name
|
self._name = name
|
||||||
else:
|
else:
|
||||||
self._name = "SevenSegement OCR {0}".format(
|
self._name = "SevenSegment OCR {0}".format(
|
||||||
split_entity_id(camera_entity)[1])
|
split_entity_id(camera_entity)[1])
|
||||||
self._state = None
|
self._state = None
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ class InputBoolean(ToggleEntity):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def icon(self):
|
def icon(self):
|
||||||
"""Returh the icon to be used for this entity."""
|
"""Return the icon to be used for this entity."""
|
||||||
return self._icon
|
return self._icon
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -72,7 +72,7 @@ ATTR_DEVICE_SYSTEM_VERSION = 'systemVersion'
|
||||||
ATTR_DEVICE_TYPE = 'type'
|
ATTR_DEVICE_TYPE = 'type'
|
||||||
ATTR_DEVICE_SYSTEM_NAME = 'systemName'
|
ATTR_DEVICE_SYSTEM_NAME = 'systemName'
|
||||||
|
|
||||||
ATTR_APP_BUNDLE_IDENTIFER = 'bundleIdentifer'
|
ATTR_APP_BUNDLE_IDENTIFIER = 'bundleIdentifier'
|
||||||
ATTR_APP_BUILD_NUMBER = 'buildNumber'
|
ATTR_APP_BUILD_NUMBER = 'buildNumber'
|
||||||
ATTR_APP_VERSION_NUMBER = 'versionNumber'
|
ATTR_APP_VERSION_NUMBER = 'versionNumber'
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ IDENTIFY_DEVICE_SCHEMA = vol.Schema({
|
||||||
IDENTIFY_DEVICE_SCHEMA_CONTAINER = vol.All(dict, IDENTIFY_DEVICE_SCHEMA)
|
IDENTIFY_DEVICE_SCHEMA_CONTAINER = vol.All(dict, IDENTIFY_DEVICE_SCHEMA)
|
||||||
|
|
||||||
IDENTIFY_APP_SCHEMA = vol.Schema({
|
IDENTIFY_APP_SCHEMA = vol.Schema({
|
||||||
vol.Required(ATTR_APP_BUNDLE_IDENTIFER): cv.string,
|
vol.Required(ATTR_APP_BUNDLE_IDENTIFIER): cv.string,
|
||||||
vol.Required(ATTR_APP_BUILD_NUMBER): cv.positive_int,
|
vol.Required(ATTR_APP_BUILD_NUMBER): cv.positive_int,
|
||||||
vol.Optional(ATTR_APP_VERSION_NUMBER): cv.string
|
vol.Optional(ATTR_APP_VERSION_NUMBER): cv.string
|
||||||
}, extra=vol.ALLOW_EXTRA)
|
}, extra=vol.ALLOW_EXTRA)
|
||||||
|
|
|
@ -123,7 +123,7 @@ SUPPORTED_DOMAINS = ['binary_sensor', 'sensor', 'lock', 'fan', 'cover',
|
||||||
'light', 'switch']
|
'light', 'switch']
|
||||||
SUPPORTED_PROGRAM_DOMAINS = ['binary_sensor', 'lock', 'fan', 'cover', 'switch']
|
SUPPORTED_PROGRAM_DOMAINS = ['binary_sensor', 'lock', 'fan', 'cover', 'switch']
|
||||||
|
|
||||||
# ISY Scenes are more like Swithes than Hass Scenes
|
# ISY Scenes are more like Switches than Hass Scenes
|
||||||
# (they can turn off, and report their state)
|
# (they can turn off, and report their state)
|
||||||
SCENE_DOMAIN = 'switch'
|
SCENE_DOMAIN = 'switch'
|
||||||
|
|
||||||
|
|
|
@ -254,7 +254,7 @@ def async_setup(hass, config):
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def async_handle_light_service(service):
|
def async_handle_light_service(service):
|
||||||
"""Hande a turn light on or off service call."""
|
"""Handle a turn light on or off service call."""
|
||||||
# Get the validated data
|
# Get the validated data
|
||||||
params = service.data.copy()
|
params = service.data.copy()
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||||
def retry(method):
|
def retry(method):
|
||||||
"""Retry bluetooth commands."""
|
"""Retry bluetooth commands."""
|
||||||
@wraps(method)
|
@wraps(method)
|
||||||
def wrapper_retry(device, *args, **kwds):
|
def wrapper_retry(device, *args, **kwargs):
|
||||||
"""Try send command and retry on error."""
|
"""Try send command and retry on error."""
|
||||||
# pylint: disable=import-error
|
# pylint: disable=import-error
|
||||||
import decora
|
import decora
|
||||||
|
@ -46,7 +46,7 @@ def retry(method):
|
||||||
if time.monotonic() - initial >= 10:
|
if time.monotonic() - initial >= 10:
|
||||||
return None
|
return None
|
||||||
try:
|
try:
|
||||||
return method(device, *args, **kwds)
|
return method(device, *args, **kwargs)
|
||||||
except (decora.decoraException, AttributeError,
|
except (decora.decoraException, AttributeError,
|
||||||
bluepy.btle.BTLEException):
|
bluepy.btle.BTLEException):
|
||||||
_LOGGER.warning("Decora connect error for device %s. "
|
_LOGGER.warning("Decora connect error for device %s. "
|
||||||
|
|
|
@ -46,7 +46,7 @@ EFFECT_GREEN_BLUE_CROSS_FADE = 'gb_cross_fade'
|
||||||
EFFECT_COLORSTROBE = 'colorstrobe'
|
EFFECT_COLORSTROBE = 'colorstrobe'
|
||||||
EFFECT_RED_STROBE = 'red_strobe'
|
EFFECT_RED_STROBE = 'red_strobe'
|
||||||
EFFECT_GREEN_STROBE = 'green_strobe'
|
EFFECT_GREEN_STROBE = 'green_strobe'
|
||||||
EFFECT_BLUE_STOBE = 'blue_strobe'
|
EFFECT_BLUE_STROBE = 'blue_strobe'
|
||||||
EFFECT_YELLOW_STROBE = 'yellow_strobe'
|
EFFECT_YELLOW_STROBE = 'yellow_strobe'
|
||||||
EFFECT_CYAN_STROBE = 'cyan_strobe'
|
EFFECT_CYAN_STROBE = 'cyan_strobe'
|
||||||
EFFECT_PURPLE_STROBE = 'purple_strobe'
|
EFFECT_PURPLE_STROBE = 'purple_strobe'
|
||||||
|
@ -68,7 +68,7 @@ EFFECT_MAP = {
|
||||||
EFFECT_COLORSTROBE: 0x30,
|
EFFECT_COLORSTROBE: 0x30,
|
||||||
EFFECT_RED_STROBE: 0x31,
|
EFFECT_RED_STROBE: 0x31,
|
||||||
EFFECT_GREEN_STROBE: 0x32,
|
EFFECT_GREEN_STROBE: 0x32,
|
||||||
EFFECT_BLUE_STOBE: 0x33,
|
EFFECT_BLUE_STROBE: 0x33,
|
||||||
EFFECT_YELLOW_STROBE: 0x34,
|
EFFECT_YELLOW_STROBE: 0x34,
|
||||||
EFFECT_CYAN_STROBE: 0x35,
|
EFFECT_CYAN_STROBE: 0x35,
|
||||||
EFFECT_PURPLE_STROBE: 0x36,
|
EFFECT_PURPLE_STROBE: 0x36,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
"""
|
"""
|
||||||
Support for Homematic lighs.
|
Support for Homematic 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.homematic/
|
https://home-assistant.io/components/light.homematic/
|
||||||
|
|
|
@ -31,7 +31,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||||
|
|
||||||
|
|
||||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
"""Set up the iGlo lighs."""
|
"""Set up the iGlo lights."""
|
||||||
host = config.get(CONF_HOST)
|
host = config.get(CONF_HOST)
|
||||||
name = config.get(CONF_NAME)
|
name = config.get(CONF_NAME)
|
||||||
port = config.get(CONF_PORT)
|
port = config.get(CONF_PORT)
|
||||||
|
|
|
@ -27,7 +27,7 @@ def setup_platform(hass, config: ConfigType,
|
||||||
|
|
||||||
|
|
||||||
class ISYLightDevice(ISYDevice, Light):
|
class ISYLightDevice(ISYDevice, Light):
|
||||||
"""Representation of an ISY994 light devie."""
|
"""Representation of an ISY994 light device."""
|
||||||
|
|
||||||
def __init__(self, node: object) -> None:
|
def __init__(self, node: object) -> None:
|
||||||
"""Initialize the ISY994 light device."""
|
"""Initialize the ISY994 light device."""
|
||||||
|
|
|
@ -57,7 +57,7 @@ def async_add_devices_discovery(hass, discovery_info, async_add_devices):
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def async_add_devices_config(hass, config, async_add_devices):
|
def async_add_devices_config(hass, config, async_add_devices):
|
||||||
"""Set up light for KNX platform configured within plattform."""
|
"""Set up light for KNX platform configured within platform."""
|
||||||
import xknx
|
import xknx
|
||||||
light = xknx.devices.Light(
|
light = xknx.devices.Light(
|
||||||
hass.data[DATA_KNX].xknx,
|
hass.data[DATA_KNX].xknx,
|
||||||
|
|
|
@ -116,7 +116,7 @@ class LogbookView(HomeAssistantView):
|
||||||
extra_urls = ['/api/logbook/{datetime}']
|
extra_urls = ['/api/logbook/{datetime}']
|
||||||
|
|
||||||
def __init__(self, config):
|
def __init__(self, config):
|
||||||
"""Initilalize the logbook view."""
|
"""Initialize the logbook view."""
|
||||||
self.config = config
|
self.config = config
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
|
|
|
@ -93,7 +93,7 @@ def async_setup(hass, config):
|
||||||
if LOGGER_LOGS in logfilter:
|
if LOGGER_LOGS in logfilter:
|
||||||
logs.update(logfilter[LOGGER_LOGS])
|
logs.update(logfilter[LOGGER_LOGS])
|
||||||
|
|
||||||
# Add new logpoints mapped to correc severity
|
# Add new logpoints mapped to correct severity
|
||||||
for key, value in logpoints.items():
|
for key, value in logpoints.items():
|
||||||
logs[key] = LOGSEVERITY[value]
|
logs[key] = LOGSEVERITY[value]
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ class AsteriskMailbox(Mailbox):
|
||||||
"""Asterisk VM Sensor."""
|
"""Asterisk VM Sensor."""
|
||||||
|
|
||||||
def __init__(self, hass, name):
|
def __init__(self, hass, name):
|
||||||
"""Initialie Asterisk mailbox."""
|
"""Initialize Asterisk mailbox."""
|
||||||
super().__init__(hass, name)
|
super().__init__(hass, name)
|
||||||
async_dispatcher_connect(
|
async_dispatcher_connect(
|
||||||
self.hass, SIGNAL_MESSAGE_UPDATE, self._update_callback)
|
self.hass, SIGNAL_MESSAGE_UPDATE, self._update_callback)
|
||||||
|
|
|
@ -122,7 +122,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||||
|
|
||||||
|
|
||||||
class BluesoundPlayer(MediaPlayerDevice):
|
class BluesoundPlayer(MediaPlayerDevice):
|
||||||
"""Represenatation of a Bluesound Player."""
|
"""Representation of a Bluesound Player."""
|
||||||
|
|
||||||
def __init__(self, hass, host, port=None, name=None, init_callback=None):
|
def __init__(self, hass, host, port=None, name=None, init_callback=None):
|
||||||
"""Initialize the media player."""
|
"""Initialize the media player."""
|
||||||
|
@ -338,7 +338,7 @@ class BluesoundPlayer(MediaPlayerDevice):
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
@Throttle(UPDATE_CAPTURE_INTERVAL)
|
@Throttle(UPDATE_CAPTURE_INTERVAL)
|
||||||
def async_update_captures(self):
|
def async_update_captures(self):
|
||||||
"""Update Capture cources."""
|
"""Update Capture sources."""
|
||||||
resp = yield from self.send_bluesound_command(
|
resp = yield from self.send_bluesound_command(
|
||||||
'RadioBrowse?service=Capture')
|
'RadioBrowse?service=Capture')
|
||||||
if not resp:
|
if not resp:
|
||||||
|
|
|
@ -205,7 +205,7 @@ class CastDevice(MediaPlayerDevice):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def media_album_artist(self):
|
def media_album_artist(self):
|
||||||
"""Album arist of current playing media (Music track only)."""
|
"""Album artist of current playing media (Music track only)."""
|
||||||
return self.media_status.album_artist if self.media_status else None
|
return self.media_status.album_artist if self.media_status else None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -273,7 +273,7 @@ class EmbyDevice(MediaPlayerDevice):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def media_season(self):
|
def media_season(self):
|
||||||
"""Season of curent playing media (TV Show only)."""
|
"""Season of current playing media (TV Show only)."""
|
||||||
return self.device.media_season
|
return self.device.media_season
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -32,7 +32,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
|
|
||||||
|
|
||||||
class CecPlayerDevice(CecDevice, MediaPlayerDevice):
|
class CecPlayerDevice(CecDevice, MediaPlayerDevice):
|
||||||
"""Representation of a HDMI device as a Media palyer."""
|
"""Representation of a HDMI device as a Media player."""
|
||||||
|
|
||||||
def __init__(self, hass: HomeAssistant, device, logical) -> None:
|
def __init__(self, hass: HomeAssistant, device, logical) -> None:
|
||||||
"""Initialize the HDMI device."""
|
"""Initialize the HDMI device."""
|
||||||
|
|
|
@ -45,7 +45,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||||
|
|
||||||
SERVICE_CALL_METHOD = 'squeezebox_call_method'
|
SERVICE_CALL_METHOD = 'squeezebox_call_method'
|
||||||
|
|
||||||
DATA_SQUEEZEBOX = 'squeexebox'
|
DATA_SQUEEZEBOX = 'squeezebox'
|
||||||
|
|
||||||
ATTR_PARAMETERS = 'parameters'
|
ATTR_PARAMETERS = 'parameters'
|
||||||
|
|
||||||
|
|
|
@ -203,7 +203,7 @@ class Volumio(MediaPlayerDevice):
|
||||||
"""Send mute command to media player."""
|
"""Send mute command to media player."""
|
||||||
mutecmd = 'mute' if mute else 'unmute'
|
mutecmd = 'mute' if mute else 'unmute'
|
||||||
if mute:
|
if mute:
|
||||||
# mute is implemenhted as 0 volume, do save last volume level
|
# mute is implemented as 0 volume, do save last volume level
|
||||||
self._lastvol = self._state['volume']
|
self._lastvol = self._state['volume']
|
||||||
return self.send_volumio_msg(
|
return self.send_volumio_msg(
|
||||||
'commands', params={'cmd': 'volume', 'volume': mutecmd})
|
'commands', params={'cmd': 'volume', 'volume': mutecmd})
|
||||||
|
|
|
@ -310,7 +310,7 @@ class YamahaDevice(MediaPlayerDevice):
|
||||||
|
|
||||||
NOTE: this might take a while, because the only API interface
|
NOTE: this might take a while, because the only API interface
|
||||||
for setting the net radio station emulates button pressing and
|
for setting the net radio station emulates button pressing and
|
||||||
navigating through the net radio menu hiearchy. And each sub
|
navigating through the net radio menu hierarchy. And each sub
|
||||||
menu must be fetched by the receiver from the vtuner service.
|
menu must be fetched by the receiver from the vtuner service.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -76,12 +76,12 @@ def is_socket_address(value):
|
||||||
|
|
||||||
|
|
||||||
def has_parent_dir(value):
|
def has_parent_dir(value):
|
||||||
"""Validate that value is in an existing directory which is writetable."""
|
"""Validate that value is in an existing directory which is writeable."""
|
||||||
parent = os.path.dirname(os.path.realpath(value))
|
parent = os.path.dirname(os.path.realpath(value))
|
||||||
is_dir_writable = os.path.isdir(parent) and os.access(parent, os.W_OK)
|
is_dir_writable = os.path.isdir(parent) and os.access(parent, os.W_OK)
|
||||||
if not is_dir_writable:
|
if not is_dir_writable:
|
||||||
raise vol.Invalid(
|
raise vol.Invalid(
|
||||||
'{} directory does not exist or is not writetable'.format(parent))
|
'{} directory does not exist or is not writeable'.format(parent))
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -183,7 +183,7 @@ class NestDevice(object):
|
||||||
"Connection error logging into the nest web service.")
|
"Connection error logging into the nest web service.")
|
||||||
|
|
||||||
def smoke_co_alarms(self):
|
def smoke_co_alarms(self):
|
||||||
"""Generate a list of smoke co alarams."""
|
"""Generate a list of smoke co alarms."""
|
||||||
try:
|
try:
|
||||||
for structure in self.nest.structures:
|
for structure in self.nest.structures:
|
||||||
if structure.name in self.local_structure:
|
if structure.name in self.local_structure:
|
||||||
|
|
|
@ -51,7 +51,7 @@ def async_get_service_discovery(hass, discovery_info):
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def async_get_service_config(hass, config):
|
def async_get_service_config(hass, config):
|
||||||
"""Set up notification for KNX platform configured within plattform."""
|
"""Set up notification for KNX platform configured within platform."""
|
||||||
import xknx
|
import xknx
|
||||||
notification = xknx.devices.Notification(
|
notification = xknx.devices.Notification(
|
||||||
hass.data[DATA_KNX].xknx,
|
hass.data[DATA_KNX].xknx,
|
||||||
|
|
|
@ -171,7 +171,7 @@ def setup(hass, config):
|
||||||
def qs_callback(item):
|
def qs_callback(item):
|
||||||
"""Typically a button press or update signal."""
|
"""Typically a button press or update signal."""
|
||||||
if qsusb is None: # Shutting down
|
if qsusb is None: # Shutting down
|
||||||
_LOGGER.info("Botton press or updating signal done")
|
_LOGGER.info("Button press or updating signal done")
|
||||||
return
|
return
|
||||||
|
|
||||||
# If button pressed, fire a hass event
|
# If button pressed, fire a hass event
|
||||||
|
|
|
@ -27,7 +27,7 @@ CONFIG_SCHEMA = vol.Schema({
|
||||||
|
|
||||||
|
|
||||||
def setup(hass, config):
|
def setup(hass, config):
|
||||||
"""Set up the Rain Bird componenent."""
|
"""Set up the Rain Bird component."""
|
||||||
conf = config[DOMAIN]
|
conf = config[DOMAIN]
|
||||||
server = conf.get(CONF_HOST)
|
server = conf.get(CONF_HOST)
|
||||||
password = conf.get(CONF_PASSWORD)
|
password = conf.get(CONF_PASSWORD)
|
||||||
|
@ -38,8 +38,8 @@ def setup(hass, config):
|
||||||
|
|
||||||
_LOGGER.debug("Rain Bird Controller set to: %s", server)
|
_LOGGER.debug("Rain Bird Controller set to: %s", server)
|
||||||
|
|
||||||
initialstatus = controller.currentIrrigation()
|
initial_status = controller.currentIrrigation()
|
||||||
if initialstatus == -1:
|
if initial_status == -1:
|
||||||
_LOGGER.error("Error getting state. Possible configuration issues")
|
_LOGGER.error("Error getting state. Possible configuration issues")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -48,8 +48,8 @@ class KiraRemote(Entity):
|
||||||
|
|
||||||
def send_command(self, command, **kwargs):
|
def send_command(self, command, **kwargs):
|
||||||
"""Send a command to one device."""
|
"""Send a command to one device."""
|
||||||
for singel_command in command:
|
for single_command in command:
|
||||||
code_tuple = (singel_command,
|
code_tuple = (single_command,
|
||||||
kwargs.get(remote.ATTR_DEVICE))
|
kwargs.get(remote.ATTR_DEVICE))
|
||||||
_LOGGER.info("Sending Command: %s to %s", *code_tuple)
|
_LOGGER.info("Sending Command: %s to %s", *code_tuple)
|
||||||
self._kira.sendCode(code_tuple)
|
self._kira.sendCode(code_tuple)
|
||||||
|
|
|
@ -77,7 +77,7 @@ def setup(hass, config):
|
||||||
"""Set up the RFXtrx component."""
|
"""Set up the RFXtrx component."""
|
||||||
# Declare the Handle event
|
# Declare the Handle event
|
||||||
def handle_receive(event):
|
def handle_receive(event):
|
||||||
"""Handle revieved messages from RFXtrx gateway."""
|
"""Handle received messages from RFXtrx gateway."""
|
||||||
# Log RFXCOM event
|
# Log RFXCOM event
|
||||||
if not event.device.id_string:
|
if not event.device.id_string:
|
||||||
return
|
return
|
||||||
|
|
|
@ -87,7 +87,7 @@ class SCSGate(object):
|
||||||
self._logger.debug("Received message {}".format(message))
|
self._logger.debug("Received message {}".format(message))
|
||||||
if not isinstance(message, StateMessage) and \
|
if not isinstance(message, StateMessage) and \
|
||||||
not isinstance(message, ScenarioTriggeredMessage):
|
not isinstance(message, ScenarioTriggeredMessage):
|
||||||
msg = "Ignored message {} - not releavant type".format(
|
msg = "Ignored message {} - not relevant type".format(
|
||||||
message)
|
message)
|
||||||
self._logger.debug(msg)
|
self._logger.debug(msg)
|
||||||
return
|
return
|
||||||
|
@ -109,7 +109,7 @@ class SCSGate(object):
|
||||||
self._logger.error(msg)
|
self._logger.error(msg)
|
||||||
else:
|
else:
|
||||||
self._logger.info(
|
self._logger.info(
|
||||||
"Ignoring state message for device {} because unknonw".format(
|
"Ignoring state message for device {} because unknown".format(
|
||||||
message.entity))
|
message.entity))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
"""
|
"""
|
||||||
Support for BME680 Sensor over SMBus.
|
Support for BME680 Sensor over SMBus.
|
||||||
|
|
||||||
Temperature, humidity, pressure and volitile gas support.
|
Temperature, humidity, pressure and volatile gas support.
|
||||||
Air Quality calculation based on humidity and volatile gas.
|
Air Quality calculation based on humidity and volatile gas.
|
||||||
|
|
||||||
For more details about this platform, please refer to the documentation at
|
For more details about this platform, please refer to the documentation at
|
||||||
|
|
|
@ -87,7 +87,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||||
async_add_devices(devices)
|
async_add_devices(devices)
|
||||||
|
|
||||||
def update_entities_telegram(telegram):
|
def update_entities_telegram(telegram):
|
||||||
"""Update entities with latests telegram and trigger state update."""
|
"""Update entities with latest telegram and trigger state update."""
|
||||||
# Make all device entities aware of new telegram
|
# Make all device entities aware of new telegram
|
||||||
for device in devices:
|
for device in devices:
|
||||||
device.telegram = telegram
|
device.telegram = telegram
|
||||||
|
@ -122,7 +122,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||||
|
|
||||||
if transport:
|
if transport:
|
||||||
# Register listener to close transport on HA shutdown
|
# Register listener to close transport on HA shutdown
|
||||||
stop_listerer = hass.bus.async_listen_once(
|
stop_listener = hass.bus.async_listen_once(
|
||||||
EVENT_HOMEASSISTANT_STOP, transport.close)
|
EVENT_HOMEASSISTANT_STOP, transport.close)
|
||||||
|
|
||||||
# Wait for reader to close
|
# Wait for reader to close
|
||||||
|
@ -131,8 +131,8 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||||
if hass.state != CoreState.stopping:
|
if hass.state != CoreState.stopping:
|
||||||
# Unexpected disconnect
|
# Unexpected disconnect
|
||||||
if transport:
|
if transport:
|
||||||
# remove listerer
|
# remove listener
|
||||||
stop_listerer()
|
stop_listener()
|
||||||
|
|
||||||
# Reflect disconnect state in devices state by setting an
|
# Reflect disconnect state in devices state by setting an
|
||||||
# empty telegram resulting in `unknown` states
|
# empty telegram resulting in `unknown` states
|
||||||
|
|
|
@ -70,7 +70,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
ebox_data = EBoxData(username, password)
|
ebox_data = EBoxData(username, password)
|
||||||
ebox_data.update()
|
ebox_data.update()
|
||||||
except requests.exceptions.HTTPError as error:
|
except requests.exceptions.HTTPError as error:
|
||||||
_LOGGER.error("Failt login: %s", error)
|
_LOGGER.error("Failed login: %s", error)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
name = config.get(CONF_NAME)
|
name = config.get(CONF_NAME)
|
||||||
|
|
|
@ -153,7 +153,7 @@ class EmonCmsSensor(Entity):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def device_state_attributes(self):
|
||||||
"""Return the atrributes of the sensor."""
|
"""Return the attributes of the sensor."""
|
||||||
return {
|
return {
|
||||||
ATTR_FEEDID: self._elem["id"],
|
ATTR_FEEDID: self._elem["id"],
|
||||||
ATTR_TAG: self._elem["tag"],
|
ATTR_TAG: self._elem["tag"],
|
||||||
|
|
|
@ -50,12 +50,12 @@ SENSOR_TYPES = {
|
||||||
'text_int_used': ['International text used',
|
'text_int_used': ['International text used',
|
||||||
MESSAGES, 'mdi:message-alert'],
|
MESSAGES, 'mdi:message-alert'],
|
||||||
'text_int_limit': ['International text limit',
|
'text_int_limit': ['International text limit',
|
||||||
MESSAGES, 'mdi:message-alart'],
|
MESSAGES, 'mdi:message-alert'],
|
||||||
'text_int_remaining': ['Internaltional remaining',
|
'text_int_remaining': ['International remaining',
|
||||||
MESSAGES, 'mdi:message-alert'],
|
MESSAGES, 'mdi:message-alert'],
|
||||||
'talk_used': ['Talk used', MINUTES, 'mdi:cellphone'],
|
'talk_used': ['Talk used', MINUTES, 'mdi:cellphone'],
|
||||||
'talk_limit': ['Talk limit', MINUTES, 'mdi:cellphone'],
|
'talk_limit': ['Talk limit', MINUTES, 'mdi:cellphone'],
|
||||||
'talt_remaining': ['Talk remaining', MINUTES, 'mdi:cellphone'],
|
'talk_remaining': ['Talk remaining', MINUTES, 'mdi:cellphone'],
|
||||||
'other_talk_used': ['Other Talk used', MINUTES, 'mdi:cellphone'],
|
'other_talk_used': ['Other Talk used', MINUTES, 'mdi:cellphone'],
|
||||||
'other_talk_limit': ['Other Talk limit', MINUTES, 'mdi:cellphone'],
|
'other_talk_limit': ['Other Talk limit', MINUTES, 'mdi:cellphone'],
|
||||||
'other_talk_remaining': ['Other Talk remaining', MINUTES, 'mdi:cellphone'],
|
'other_talk_remaining': ['Other Talk remaining', MINUTES, 'mdi:cellphone'],
|
||||||
|
|
|
@ -52,7 +52,7 @@ def async_add_devices_discovery(hass, discovery_info, async_add_devices):
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def async_add_devices_config(hass, config, async_add_devices):
|
def async_add_devices_config(hass, config, async_add_devices):
|
||||||
"""Set up sensor for KNX platform configured within plattform."""
|
"""Set up sensor for KNX platform configured within platform."""
|
||||||
import xknx
|
import xknx
|
||||||
sensor = xknx.devices.Sensor(
|
sensor = xknx.devices.Sensor(
|
||||||
hass.data[DATA_KNX].xknx,
|
hass.data[DATA_KNX].xknx,
|
||||||
|
|
|
@ -47,7 +47,7 @@ CONDITION_CLASSES = {
|
||||||
|
|
||||||
DEFAULT_NAME = "Met Office"
|
DEFAULT_NAME = "Met Office"
|
||||||
|
|
||||||
VISIBILTY_CLASSES = {
|
VISIBILITY_CLASSES = {
|
||||||
'VP': '<1',
|
'VP': '<1',
|
||||||
'PO': '1-4',
|
'PO': '1-4',
|
||||||
'MO': '4-10',
|
'MO': '4-10',
|
||||||
|
@ -144,7 +144,7 @@ class MetOfficeCurrentSensor(Entity):
|
||||||
"""Return the state of the sensor."""
|
"""Return the state of the sensor."""
|
||||||
if (self._condition == 'visibility_distance' and
|
if (self._condition == 'visibility_distance' and
|
||||||
hasattr(self.data.data, 'visibility')):
|
hasattr(self.data.data, 'visibility')):
|
||||||
return VISIBILTY_CLASSES.get(self.data.data.visibility.value)
|
return VISIBILITY_CLASSES.get(self.data.data.visibility.value)
|
||||||
if hasattr(self.data.data, self._condition):
|
if hasattr(self.data.data, self._condition):
|
||||||
variable = getattr(self.data.data, self._condition)
|
variable = getattr(self.data.data, self._condition)
|
||||||
if self._condition == 'weather':
|
if self._condition == 'weather':
|
||||||
|
|
|
@ -18,7 +18,7 @@ REQUIREMENTS = ['basicmodem==0.7']
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
DEFAULT_NAME = 'Modem CallerID'
|
DEFAULT_NAME = 'Modem CallerID'
|
||||||
ICON = 'mdi:phone-clasic'
|
ICON = 'mdi:phone-classic'
|
||||||
DEFAULT_DEVICE = '/dev/ttyACM0'
|
DEFAULT_DEVICE = '/dev/ttyACM0'
|
||||||
|
|
||||||
STATE_RING = 'ring'
|
STATE_RING = 'ring'
|
||||||
|
|
|
@ -243,7 +243,7 @@ class PyNUTData(object):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, host, port, alias, username, password):
|
def __init__(self, host, port, alias, username, password):
|
||||||
"""Initialize the data oject."""
|
"""Initialize the data object."""
|
||||||
from pynut2.nut2 import PyNUTClient, PyNUTError
|
from pynut2.nut2 import PyNUTClient, PyNUTError
|
||||||
self._host = host
|
self._host = host
|
||||||
self._port = port
|
self._port = port
|
||||||
|
|
|
@ -22,7 +22,7 @@ _LOGGER = logging.getLogger(__name__)
|
||||||
SENSOR_TYPES = {
|
SENSOR_TYPES = {
|
||||||
'status': ['Charging Status', None],
|
'status': ['Charging Status', None],
|
||||||
'charge_time': ['Charge Time Elapsed', 'minutes'],
|
'charge_time': ['Charge Time Elapsed', 'minutes'],
|
||||||
'ambient_temp': ['Ambient Termperature', TEMP_CELSIUS],
|
'ambient_temp': ['Ambient Temperature', TEMP_CELSIUS],
|
||||||
'ir_temp': ['IR Temperature', TEMP_CELSIUS],
|
'ir_temp': ['IR Temperature', TEMP_CELSIUS],
|
||||||
'rtc_temp': ['RTC Temperature', TEMP_CELSIUS],
|
'rtc_temp': ['RTC Temperature', TEMP_CELSIUS],
|
||||||
'usage_session': ['Usage this Session', 'kWh'],
|
'usage_session': ['Usage this Session', 'kWh'],
|
||||||
|
|
|
@ -79,10 +79,10 @@ class PilightSensor(Entity):
|
||||||
def _handle_code(self, call):
|
def _handle_code(self, call):
|
||||||
"""Handle received code by the pilight-daemon.
|
"""Handle received code by the pilight-daemon.
|
||||||
|
|
||||||
If the code matches the defined playload
|
If the code matches the defined payload
|
||||||
of this sensor the sensor state is changed accordingly.
|
of this sensor the sensor state is changed accordingly.
|
||||||
"""
|
"""
|
||||||
# Check if received code matches defined playoad
|
# Check if received code matches defined payload
|
||||||
# True if payload is contained in received code dict, not
|
# True if payload is contained in received code dict, not
|
||||||
# all items have to match
|
# all items have to match
|
||||||
if self._payload.items() <= call.data.items():
|
if self._payload.items() <= call.data.items():
|
||||||
|
|
|
@ -38,7 +38,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||||
|
|
||||||
|
|
||||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
"""Set up the Pushbllet Sensor platform."""
|
"""Set up the Pushbullet Sensor platform."""
|
||||||
from pushbullet import PushBullet
|
from pushbullet import PushBullet
|
||||||
from pushbullet import InvalidKeyError
|
from pushbullet import InvalidKeyError
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -91,7 +91,7 @@ class StatisticsSensor(Entity):
|
||||||
|
|
||||||
if 'recorder' in self._hass.config.components:
|
if 'recorder' in self._hass.config.components:
|
||||||
# only use the database if it's configured
|
# only use the database if it's configured
|
||||||
hass.async_add_job(self._initzialize_from_database)
|
hass.async_add_job(self._initialize_from_database)
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
# pylint: disable=invalid-name
|
# pylint: disable=invalid-name
|
||||||
|
@ -202,7 +202,7 @@ class StatisticsSensor(Entity):
|
||||||
self.average_change = self.change = STATE_UNKNOWN
|
self.average_change = self.change = STATE_UNKNOWN
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def _initzialize_from_database(self):
|
def _initialize_from_database(self):
|
||||||
"""Initialize the list of states from the database.
|
"""Initialize the list of states from the database.
|
||||||
|
|
||||||
The query will get the list of states in DESCENDING order so that we
|
The query will get the list of states in DESCENDING order so that we
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
"""
|
"""
|
||||||
Support gahtering ted500 information.
|
Support gathering ted500 information.
|
||||||
|
|
||||||
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/sensor.ted5000/
|
https://home-assistant.io/components/sensor.ted5000/
|
||||||
|
|
|
@ -79,7 +79,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
|
|
||||||
sensors = []
|
sensors = []
|
||||||
|
|
||||||
# non specificy repository selected, then show all associated
|
# non specific repository selected, then show all associated
|
||||||
if not repositories:
|
if not repositories:
|
||||||
all_repos = travis.repos(member=user.login)
|
all_repos = travis.repos(member=user.login)
|
||||||
repositories = [repo.slug for repo in all_repos]
|
repositories = [repo.slug for repo in all_repos]
|
||||||
|
|
|
@ -132,7 +132,7 @@ class UkTransportSensor(Entity):
|
||||||
_LOGGER.warning('Invalid response from API')
|
_LOGGER.warning('Invalid response from API')
|
||||||
elif 'error' in response.json():
|
elif 'error' in response.json():
|
||||||
if 'exceeded' in response.json()['error']:
|
if 'exceeded' in response.json()['error']:
|
||||||
self._state = 'Useage limites exceeded'
|
self._state = 'Usage limits exceeded'
|
||||||
if 'invalid' in response.json()['error']:
|
if 'invalid' in response.json()['error']:
|
||||||
self._state = 'Credentials invalid'
|
self._state = 'Credentials invalid'
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -84,7 +84,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||||
dev.append(waqi_sensor)
|
dev.append(waqi_sensor)
|
||||||
except (aiohttp.client_exceptions.ClientConnectorError,
|
except (aiohttp.client_exceptions.ClientConnectorError,
|
||||||
asyncio.TimeoutError):
|
asyncio.TimeoutError):
|
||||||
_LOGGER.exception('Failed to connct to WAQI servers.')
|
_LOGGER.exception('Failed to connect to WAQI servers.')
|
||||||
raise PlatformNotReady
|
raise PlatformNotReady
|
||||||
async_add_devices(dev, True)
|
async_add_devices(dev, True)
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ class WUSensorConfig(object):
|
||||||
https://www.wunderground.com/weather/api/d/docs?d=data/index
|
https://www.wunderground.com/weather/api/d/docs?d=data/index
|
||||||
value (function(WUndergroundData)): callback that
|
value (function(WUndergroundData)): callback that
|
||||||
extracts desired value from WUndergroundData object
|
extracts desired value from WUndergroundData object
|
||||||
unit_of_measurement (string): unit of meassurement
|
unit_of_measurement (string): unit of measurement
|
||||||
entity_picture (string): value or callback returning
|
entity_picture (string): value or callback returning
|
||||||
URL of entity picture
|
URL of entity picture
|
||||||
icon (string): icon name or URL
|
icon (string): icon name or URL
|
||||||
|
@ -84,7 +84,7 @@ class WUCurrentConditionsSensorConfig(WUSensorConfig):
|
||||||
dictionary.
|
dictionary.
|
||||||
icon (string): icon name or URL, if None sensor
|
icon (string): icon name or URL, if None sensor
|
||||||
will use current weather symbol
|
will use current weather symbol
|
||||||
unit_of_measurement (string): unit of meassurement
|
unit_of_measurement (string): unit of measurement
|
||||||
"""
|
"""
|
||||||
super().__init__(
|
super().__init__(
|
||||||
friendly_name,
|
friendly_name,
|
||||||
|
@ -230,7 +230,7 @@ class WUAlmanacSensorConfig(WUSensorConfig):
|
||||||
value_type (string): "record" or "normal"
|
value_type (string): "record" or "normal"
|
||||||
wu_unit (string): unit name in WU API
|
wu_unit (string): unit name in WU API
|
||||||
icon (string): icon name or URL
|
icon (string): icon name or URL
|
||||||
unit_of_measurement (string): unit of meassurement
|
unit_of_measurement (string): unit of measurement
|
||||||
"""
|
"""
|
||||||
super().__init__(
|
super().__init__(
|
||||||
friendly_name=friendly_name,
|
friendly_name=friendly_name,
|
||||||
|
|
|
@ -236,7 +236,7 @@ def closest_station(lat, lon, cache_dir):
|
||||||
stations = zamg_stations(cache_dir)
|
stations = zamg_stations(cache_dir)
|
||||||
|
|
||||||
def comparable_dist(zamg_id):
|
def comparable_dist(zamg_id):
|
||||||
"""Calculate the psudeo-distance from lat/lon."""
|
"""Calculate the pseudo-distance from lat/lon."""
|
||||||
station_lat, station_lon = stations[zamg_id]
|
station_lat, station_lon = stations[zamg_id]
|
||||||
return (lat - station_lat) ** 2 + (lon - station_lon) ** 2
|
return (lat - station_lat) ** 2 + (lon - station_lon) ** 2
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
"""Component to manage a shoppling list."""
|
"""Component to manage a shopping list."""
|
||||||
import asyncio
|
import asyncio
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
|
|
@ -155,7 +155,7 @@ def async_setup(hass, config):
|
||||||
|
|
||||||
|
|
||||||
def resolve_slot_values(slot):
|
def resolve_slot_values(slot):
|
||||||
"""Convert snips builtin types to useable values."""
|
"""Convert snips builtin types to usable values."""
|
||||||
if 'value' in slot['value']:
|
if 'value' in slot['value']:
|
||||||
value = slot['value']['value']
|
value = slot['value']['value']
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -103,13 +103,13 @@ class AcerSwitch(SwitchDevice):
|
||||||
# need to wait for timeout
|
# need to wait for timeout
|
||||||
ret = self.ser.read_until(size=20).decode('utf-8')
|
ret = self.ser.read_until(size=20).decode('utf-8')
|
||||||
except serial.SerialException:
|
except serial.SerialException:
|
||||||
_LOGGER.error('Problem comunicating with %s', self._serial_port)
|
_LOGGER.error('Problem communicating with %s', self._serial_port)
|
||||||
self.ser.close()
|
self.ser.close()
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def _write_read_format(self, msg):
|
def _write_read_format(self, msg):
|
||||||
"""Write msg, obtain awnser and format output."""
|
"""Write msg, obtain answer and format output."""
|
||||||
# awnsers are formatted as ***\rawnser\r***
|
# answers are formatted as ***\answer\r***
|
||||||
awns = self._write_read(msg)
|
awns = self._write_read(msg)
|
||||||
match = re.search(r'\r(.+)\r', awns)
|
match = re.search(r'\r(.+)\r', awns)
|
||||||
if match:
|
if match:
|
||||||
|
|
|
@ -33,7 +33,7 @@ CONF_START_CT = 'start_colortemp'
|
||||||
CONF_SUNSET_CT = 'sunset_colortemp'
|
CONF_SUNSET_CT = 'sunset_colortemp'
|
||||||
CONF_STOP_CT = 'stop_colortemp'
|
CONF_STOP_CT = 'stop_colortemp'
|
||||||
CONF_BRIGHTNESS = 'brightness'
|
CONF_BRIGHTNESS = 'brightness'
|
||||||
CONF_DISABLE_BRIGTNESS_ADJUST = 'disable_brightness_adjust'
|
CONF_DISABLE_BRIGHTNESS_ADJUST = 'disable_brightness_adjust'
|
||||||
CONF_INTERVAL = 'interval'
|
CONF_INTERVAL = 'interval'
|
||||||
|
|
||||||
MODE_XY = 'xy'
|
MODE_XY = 'xy'
|
||||||
|
@ -57,7 +57,7 @@ PLATFORM_SCHEMA = vol.Schema({
|
||||||
vol.All(vol.Coerce(int), vol.Range(min=1000, max=40000)),
|
vol.All(vol.Coerce(int), vol.Range(min=1000, max=40000)),
|
||||||
vol.Optional(CONF_BRIGHTNESS):
|
vol.Optional(CONF_BRIGHTNESS):
|
||||||
vol.All(vol.Coerce(int), vol.Range(min=0, max=255)),
|
vol.All(vol.Coerce(int), vol.Range(min=0, max=255)),
|
||||||
vol.Optional(CONF_DISABLE_BRIGTNESS_ADJUST): cv.boolean,
|
vol.Optional(CONF_DISABLE_BRIGHTNESS_ADJUST): cv.boolean,
|
||||||
vol.Optional(CONF_MODE, default=DEFAULT_MODE):
|
vol.Optional(CONF_MODE, default=DEFAULT_MODE):
|
||||||
vol.Any(MODE_XY, MODE_MIRED, MODE_RGB),
|
vol.Any(MODE_XY, MODE_MIRED, MODE_RGB),
|
||||||
vol.Optional(CONF_INTERVAL, default=30): cv.positive_int,
|
vol.Optional(CONF_INTERVAL, default=30): cv.positive_int,
|
||||||
|
@ -105,7 +105,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
sunset_colortemp = config.get(CONF_SUNSET_CT)
|
sunset_colortemp = config.get(CONF_SUNSET_CT)
|
||||||
stop_colortemp = config.get(CONF_STOP_CT)
|
stop_colortemp = config.get(CONF_STOP_CT)
|
||||||
brightness = config.get(CONF_BRIGHTNESS)
|
brightness = config.get(CONF_BRIGHTNESS)
|
||||||
disable_brightness_adjust = config.get(CONF_DISABLE_BRIGTNESS_ADJUST)
|
disable_brightness_adjust = config.get(CONF_DISABLE_BRIGHTNESS_ADJUST)
|
||||||
mode = config.get(CONF_MODE)
|
mode = config.get(CONF_MODE)
|
||||||
interval = config.get(CONF_INTERVAL)
|
interval = config.get(CONF_INTERVAL)
|
||||||
transition = config.get(ATTR_TRANSITION)
|
transition = config.get(ATTR_TRANSITION)
|
||||||
|
|
|
@ -51,7 +51,7 @@ def async_add_devices_discovery(hass, discovery_info, async_add_devices):
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def async_add_devices_config(hass, config, async_add_devices):
|
def async_add_devices_config(hass, config, async_add_devices):
|
||||||
"""Set up switch for KNX platform configured within plattform."""
|
"""Set up switch for KNX platform configured within platform."""
|
||||||
import xknx
|
import xknx
|
||||||
switch = xknx.devices.Switch(
|
switch = xknx.devices.Switch(
|
||||||
hass.data[DATA_KNX].xknx,
|
hass.data[DATA_KNX].xknx,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
"""
|
"""
|
||||||
Support for Neato Connected Vaccums switches.
|
Support for Neato Connected Vacuums switches.
|
||||||
|
|
||||||
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/switch.neato/
|
https://home-assistant.io/components/switch.neato/
|
||||||
|
@ -68,7 +68,7 @@ class NeatoConnectedSwitch(ToggleEntity):
|
||||||
self._schedule_state = STATE_ON
|
self._schedule_state = STATE_ON
|
||||||
else:
|
else:
|
||||||
self._schedule_state = STATE_OFF
|
self._schedule_state = STATE_OFF
|
||||||
_LOGGER.debug("Shedule state: %s", self._schedule_state)
|
_LOGGER.debug("Schedule state: %s", self._schedule_state)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
|
|
|
@ -19,9 +19,9 @@ from homeassistant.helpers.restore_state import async_get_last_state
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
CONF_OFF_CODE = 'off_code'
|
CONF_OFF_CODE = 'off_code'
|
||||||
CONF_OFF_CODE_RECIEVE = 'off_code_receive'
|
CONF_OFF_CODE_RECEIVE = 'off_code_receive'
|
||||||
CONF_ON_CODE = 'on_code'
|
CONF_ON_CODE = 'on_code'
|
||||||
CONF_ON_CODE_RECIEVE = 'on_code_receive'
|
CONF_ON_CODE_RECEIVE = 'on_code_receive'
|
||||||
CONF_SYSTEMCODE = 'systemcode'
|
CONF_SYSTEMCODE = 'systemcode'
|
||||||
CONF_UNIT = 'unit'
|
CONF_UNIT = 'unit'
|
||||||
CONF_UNITCODE = 'unitcode'
|
CONF_UNITCODE = 'unitcode'
|
||||||
|
@ -48,9 +48,9 @@ SWITCHES_SCHEMA = vol.Schema({
|
||||||
vol.Required(CONF_ON_CODE): COMMAND_SCHEMA,
|
vol.Required(CONF_ON_CODE): COMMAND_SCHEMA,
|
||||||
vol.Required(CONF_OFF_CODE): COMMAND_SCHEMA,
|
vol.Required(CONF_OFF_CODE): COMMAND_SCHEMA,
|
||||||
vol.Optional(CONF_NAME): cv.string,
|
vol.Optional(CONF_NAME): cv.string,
|
||||||
vol.Optional(CONF_OFF_CODE_RECIEVE, default=[]): vol.All(cv.ensure_list,
|
vol.Optional(CONF_OFF_CODE_RECEIVE, default=[]): vol.All(cv.ensure_list,
|
||||||
[COMMAND_SCHEMA]),
|
[COMMAND_SCHEMA]),
|
||||||
vol.Optional(CONF_ON_CODE_RECIEVE, default=[]): vol.All(cv.ensure_list,
|
vol.Optional(CONF_ON_CODE_RECEIVE, default=[]): vol.All(cv.ensure_list,
|
||||||
[COMMAND_SCHEMA])
|
[COMMAND_SCHEMA])
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -72,8 +72,8 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
properties.get(CONF_NAME, dev_name),
|
properties.get(CONF_NAME, dev_name),
|
||||||
properties.get(CONF_ON_CODE),
|
properties.get(CONF_ON_CODE),
|
||||||
properties.get(CONF_OFF_CODE),
|
properties.get(CONF_OFF_CODE),
|
||||||
properties.get(CONF_ON_CODE_RECIEVE),
|
properties.get(CONF_ON_CODE_RECEIVE),
|
||||||
properties.get(CONF_OFF_CODE_RECIEVE)
|
properties.get(CONF_OFF_CODE_RECEIVE)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -134,7 +134,7 @@ class RachioIro(object):
|
||||||
return self._running
|
return self._running
|
||||||
|
|
||||||
def list_zones(self, include_disabled=False):
|
def list_zones(self, include_disabled=False):
|
||||||
"""Return alist of the zones connected to the device, incl. data."""
|
"""Return a list of the zones connected to the device, incl. data."""
|
||||||
if not self._zones:
|
if not self._zones:
|
||||||
self._zones = [RachioZone(self.rachio, self, zone['id'],
|
self._zones = [RachioZone(self.rachio, self, zone['id'],
|
||||||
self.manual_run_mins)
|
self.manual_run_mins)
|
||||||
|
|
|
@ -52,7 +52,7 @@ class RainBirdSwitch(SwitchDevice):
|
||||||
self._devid = dev_id
|
self._devid = dev_id
|
||||||
self._zone = int(dev.get(CONF_ZONE))
|
self._zone = int(dev.get(CONF_ZONE))
|
||||||
self._name = dev.get(CONF_FRIENDLY_NAME,
|
self._name = dev.get(CONF_FRIENDLY_NAME,
|
||||||
"Sprinker {}".format(self._zone))
|
"Sprinkler {}".format(self._zone))
|
||||||
self._state = None
|
self._state = None
|
||||||
self._duration = dev.get(CONF_TRIGGER_TIME)
|
self._duration = dev.get(CONF_TRIGGER_TIME)
|
||||||
self._attributes = {
|
self._attributes = {
|
||||||
|
|
|
@ -65,7 +65,7 @@ def setup(hass, config):
|
||||||
api.get_setup()
|
api.get_setup()
|
||||||
devices = api.get_devices()
|
devices = api.get_devices()
|
||||||
except RequestException:
|
except RequestException:
|
||||||
_LOGGER.exception("Cannot fetch informations from Tahoma API")
|
_LOGGER.exception("Cannot fetch information from Tahoma API")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
hass.data[DOMAIN] = {
|
hass.data[DOMAIN] = {
|
||||||
|
|
|
@ -330,7 +330,7 @@ class TelegramNotificationService:
|
||||||
This can be one of (message_id, inline_message_id) from a msg dict,
|
This can be one of (message_id, inline_message_id) from a msg dict,
|
||||||
returning a tuple.
|
returning a tuple.
|
||||||
**You can use 'last' as message_id** to edit
|
**You can use 'last' as message_id** to edit
|
||||||
the last sended message in the chat_id.
|
the message last sent in the chat_id.
|
||||||
"""
|
"""
|
||||||
message_id = inline_message_id = None
|
message_id = inline_message_id = None
|
||||||
if ATTR_MESSAGEID in msg_data:
|
if ATTR_MESSAGEID in msg_data:
|
||||||
|
@ -354,7 +354,7 @@ class TelegramNotificationService:
|
||||||
chat_ids = [t for t in target if t in self.allowed_chat_ids]
|
chat_ids = [t for t in target if t in self.allowed_chat_ids]
|
||||||
if chat_ids:
|
if chat_ids:
|
||||||
return chat_ids
|
return chat_ids
|
||||||
_LOGGER.warning("Unallowed targets: %s, using default: %s",
|
_LOGGER.warning("Disallowed targets: %s, using default: %s",
|
||||||
target, self._default_user)
|
target, self._default_user)
|
||||||
return [self._default_user]
|
return [self._default_user]
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ class USPSData(object):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, session, name):
|
def __init__(self, session, name):
|
||||||
"""Initialize the data oject."""
|
"""Initialize the data object."""
|
||||||
self.session = session
|
self.session = session
|
||||||
self.name = name
|
self.name = name
|
||||||
self.packages = []
|
self.packages = []
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
"""
|
"""
|
||||||
Support for Neato Connected Vaccums.
|
Support for Neato Connected Vacuums.
|
||||||
|
|
||||||
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/vacuum.neato/
|
https://home-assistant.io/components/vacuum.neato/
|
||||||
|
|
|
@ -93,7 +93,7 @@ def setup(hass, config):
|
||||||
hass, component, DOMAIN, (vehicle.vin, attr), config)
|
hass, component, DOMAIN, (vehicle.vin, attr), config)
|
||||||
|
|
||||||
def update_vehicle(vehicle):
|
def update_vehicle(vehicle):
|
||||||
"""Revieve updated information on vehicle."""
|
"""Receive updated information on vehicle."""
|
||||||
state.vehicles[vehicle.vin] = vehicle
|
state.vehicles[vehicle.vin] = vehicle
|
||||||
if vehicle.vin not in state.entities:
|
if vehicle.vin not in state.entities:
|
||||||
discover_vehicle(vehicle)
|
discover_vehicle(vehicle)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
"""
|
"""
|
||||||
Patform for retrieving meteorological data from Dark Sky.
|
Platform for retrieving meteorological data from Dark Sky.
|
||||||
|
|
||||||
For more details about this platform, please refer to the documentation
|
For more details about this platform, please refer to the documentation
|
||||||
https://home-assistant.io/components/weather.darksky/
|
https://home-assistant.io/components/weather.darksky/
|
||||||
|
|
|
@ -180,7 +180,7 @@ class WeatherData(object):
|
||||||
|
|
||||||
@Throttle(MIN_TIME_BETWEEN_FORECAST_UPDATES)
|
@Throttle(MIN_TIME_BETWEEN_FORECAST_UPDATES)
|
||||||
def update_forecast(self):
|
def update_forecast(self):
|
||||||
"""Get the lastest forecast from OpenWeatherMap."""
|
"""Get the latest forecast from OpenWeatherMap."""
|
||||||
from pyowm.exceptions.api_call_error import APICallError
|
from pyowm.exceptions.api_call_error import APICallError
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -182,8 +182,8 @@ SPECIFIC_TYPE_NOT_USED = 0 # Available in all Generic types
|
||||||
|
|
||||||
GENERIC_TYPE_AV_CONTROL_POINT = 3
|
GENERIC_TYPE_AV_CONTROL_POINT = 3
|
||||||
SPECIFIC_TYPE_DOORBELL = 18
|
SPECIFIC_TYPE_DOORBELL = 18
|
||||||
SPECIFIC_TYPE_SATELLITE_RECIEVER = 4
|
SPECIFIC_TYPE_SATELLITE_RECEIVER = 4
|
||||||
SPECIFIC_TYPE_SATELLITE_RECIEVER_V2 = 17
|
SPECIFIC_TYPE_SATELLITE_RECEIVER_V2 = 17
|
||||||
|
|
||||||
GENERIC_TYPE_DISPLAY = 4
|
GENERIC_TYPE_DISPLAY = 4
|
||||||
SPECIFIC_TYPE_SIMPLE_DISPLAY = 1
|
SPECIFIC_TYPE_SIMPLE_DISPLAY = 1
|
||||||
|
|
|
@ -77,7 +77,7 @@ class Entity(object):
|
||||||
# Protect for multiple updates
|
# Protect for multiple updates
|
||||||
_update_staged = False
|
_update_staged = False
|
||||||
|
|
||||||
# Process updates pararell
|
# Process updates in parallel
|
||||||
parallel_updates = None
|
parallel_updates = None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -231,7 +231,7 @@ def async_track_time_interval(hass, action, interval):
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def interval_listener(now):
|
def interval_listener(now):
|
||||||
"""Handle elaspsed intervals."""
|
"""Handle elapsed intervals."""
|
||||||
nonlocal remove
|
nonlocal remove
|
||||||
remove = async_track_point_in_utc_time(
|
remove = async_track_point_in_utc_time(
|
||||||
hass, interval_listener, next_interval())
|
hass, interval_listener, next_interval())
|
||||||
|
|
|
@ -220,7 +220,7 @@ class Script():
|
||||||
def async_script_timeout(now):
|
def async_script_timeout(now):
|
||||||
"""Call after timeout is retrieve stop script."""
|
"""Call after timeout is retrieve stop script."""
|
||||||
self._async_listener.remove(unsub)
|
self._async_listener.remove(unsub)
|
||||||
self._log("Timout reach, abort script.")
|
self._log("Timeout reached, abort script.")
|
||||||
self.async_stop()
|
self.async_stop()
|
||||||
|
|
||||||
unsub = async_track_point_in_utc_time(
|
unsub = async_track_point_in_utc_time(
|
||||||
|
|
|
@ -438,7 +438,7 @@ def multiply(value, amount):
|
||||||
|
|
||||||
|
|
||||||
def logarithm(value, base=math.e):
|
def logarithm(value, base=math.e):
|
||||||
"""Filter to get logarithm of the value with a spesific base."""
|
"""Filter to get logarithm of the value with a specific base."""
|
||||||
try:
|
try:
|
||||||
return math.log(float(value), float(base))
|
return math.log(float(value), float(base))
|
||||||
except (ValueError, TypeError):
|
except (ValueError, TypeError):
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue