Merge pull request #20930 from home-assistant/rc

0.87.1
This commit is contained in:
Paulus Schoutsen 2019-02-10 10:06:50 -08:00 committed by GitHub
commit 4a559cd4df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 41 additions and 21 deletions

View file

@ -123,7 +123,7 @@ def _set_location(hass, data, location_name):
)
return web.Response(
body="Setting location for {}".format(device),
text="Setting location for {}".format(device),
status=HTTP_OK
)

View file

@ -66,7 +66,7 @@ async def handle_webhook(hass, webhook_id, request):
data = WEBHOOK_SCHEMA(dict(await request.post()))
except vol.MultipleInvalid as error:
return web.Response(
body=error.error_message,
text=error.error_message,
status=HTTP_UNPROCESSABLE_ENTITY
)
@ -91,7 +91,7 @@ async def handle_webhook(hass, webhook_id, request):
)
return web.Response(
body='Setting location for {}'.format(device),
text='Setting location for {}'.format(device),
status=HTTP_OK
)

View file

@ -224,7 +224,12 @@ class HomeKitEntity(Entity):
if service['iid'] != self._iid:
continue
for char in service['characteristics']:
uuid = CharacteristicsTypes.get_uuid(char['type'])
try:
uuid = CharacteristicsTypes.get_uuid(char['type'])
except KeyError:
# If a KeyError is raised its a non-standard
# characteristic. We must ignore it in this case.
continue
if uuid not in characteristic_types:
continue
self._setup_characteristic(char)

View file

@ -101,7 +101,7 @@ async def handle_webhook(hass, webhook_id, request):
location_name
)
return web.Response(
body='Setting location to not home',
text='Setting location to not home',
status=HTTP_OK
)
@ -110,7 +110,7 @@ async def handle_webhook(hass, webhook_id, request):
# before the previous zone was exited. The enter message will
# be sent first, then the exit message will be sent second.
return web.Response(
body='Ignoring exit from {} (already in {})'.format(
text='Ignoring exit from {} (already in {})'.format(
location_name, current_state
),
status=HTTP_OK
@ -120,14 +120,14 @@ async def handle_webhook(hass, webhook_id, request):
# In the app, a test message can be sent. Just return something to
# the user to let them know that it works.
return web.Response(
body='Received test message.',
text='Received test message.',
status=HTTP_OK
)
_LOGGER.error('Received unidentified message from Locative: %s',
direction)
return web.Response(
body='Received unidentified message: {}'.format(direction),
text='Received unidentified message: {}'.format(direction),
status=HTTP_UNPROCESSABLE_ENTITY
)

View file

@ -80,7 +80,7 @@ class VerisureDoorlock(LockDevice):
"$.doorLockStatusList[?(@.deviceLabel=='%s')].lockedState",
self._device_label)
if status == 'UNLOCKED':
self._state = None
self._state = STATE_UNLOCKED
elif status == 'LOCKED':
self._state = STATE_LOCKED
elif status != 'PENDING':

View file

@ -4,10 +4,12 @@ Support for monitoring the Transmission BitTorrent client API.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.transmission/
"""
from datetime import timedelta
import logging
from homeassistant.components.transmission import (
DATA_TRANSMISSION, SENSOR_TYPES, SCAN_INTERVAL)
DATA_TRANSMISSION, SENSOR_TYPES)
from homeassistant.const import STATE_IDLE
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
@ -18,6 +20,8 @@ _LOGGER = logging.getLogger(__name__)
DEFAULT_NAME = 'Transmission'
SCAN_INTERVAL = timedelta(seconds=120)
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Transmission sensors."""

View file

@ -16,6 +16,7 @@ from homeassistant.const import (
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers import location
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
REQUIREMENTS = ['WazeRouteCalculator==0.6']
@ -40,6 +41,7 @@ ICON = 'mdi:car'
REGIONS = ['US', 'NA', 'EU', 'IL', 'AU']
SCAN_INTERVAL = timedelta(minutes=5)
MIN_TIME_BETWEEN_UPDATES = timedelta(minutes=5)
TRACKABLE_DOMAINS = ['device_tracker', 'sensor', 'zone']
@ -67,7 +69,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
sensor = WazeTravelTime(name, origin, destination, region,
incl_filter, excl_filter, realtime)
add_entities([sensor])
add_entities([sensor], True)
# Wait until start event is sent to load this component.
hass.bus.listen_once(
@ -182,6 +184,7 @@ class WazeTravelTime(Entity):
return friendly_name
@Throttle(MIN_TIME_BETWEEN_UPDATES)
def update(self):
"""Fetch new state data for the sensor."""
import WazeRouteCalculator

View file

@ -4,10 +4,12 @@ Support for setting the Transmission BitTorrent client Turtle Mode.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.transmission/
"""
from datetime import timedelta
import logging
from homeassistant.components.transmission import (
DATA_TRANSMISSION, SCAN_INTERVAL)
DATA_TRANSMISSION)
from homeassistant.const import (
STATE_OFF, STATE_ON)
from homeassistant.helpers.entity import ToggleEntity
@ -19,6 +21,8 @@ _LOGGING = logging.getLogger(__name__)
DEFAULT_NAME = 'Transmission Turtle Mode'
SCAN_INTERVAL = timedelta(seconds=120)
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Transmission switch."""

View file

@ -15,7 +15,8 @@ from homeassistant.const import (
CONF_NAME,
CONF_PASSWORD,
CONF_PORT,
CONF_USERNAME
CONF_USERNAME,
CONF_SCAN_INTERVAL
)
from homeassistant.helpers import discovery, config_validation as cv
from homeassistant.helpers.event import track_time_interval
@ -42,6 +43,8 @@ SENSOR_TYPES = {
'started_torrents': ['Started Torrents', None],
}
DEFAULT_SCAN_INTERVAL = timedelta(seconds=120)
CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.Schema({
vol.Required(CONF_HOST): cv.string,
@ -50,20 +53,21 @@ CONFIG_SCHEMA = vol.Schema({
vol.Optional(CONF_PORT, default=DEFAULT_PORT): cv.port,
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
vol.Optional(TURTLE_MODE, default=False): cv.boolean,
vol.Optional(CONF_SCAN_INTERVAL, default=DEFAULT_SCAN_INTERVAL):
cv.time_period,
vol.Optional(CONF_MONITORED_CONDITIONS, default=['current_status']):
vol.All(cv.ensure_list, [vol.In(SENSOR_TYPES)]),
})
}, extra=vol.ALLOW_EXTRA)
SCAN_INTERVAL = timedelta(minutes=2)
def setup(hass, config):
"""Set up the Transmission Component."""
host = config[DOMAIN][CONF_HOST]
username = config[DOMAIN][CONF_USERNAME]
password = config[DOMAIN][CONF_PASSWORD]
username = config[DOMAIN].get(CONF_USERNAME)
password = config[DOMAIN].get(CONF_PASSWORD)
port = config[DOMAIN][CONF_PORT]
scan_interval = config[DOMAIN][CONF_SCAN_INTERVAL]
import transmissionrpc
from transmissionrpc.error import TransmissionError
@ -85,7 +89,7 @@ def setup(hass, config):
"""Get the latest data from Transmission."""
tm_data.update()
track_time_interval(hass, refresh, SCAN_INTERVAL)
track_time_interval(hass, refresh, scan_interval)
sensorconfig = {
'sensors': config[DOMAIN][CONF_MONITORED_CONDITIONS],

View file

@ -16,7 +16,7 @@ from homeassistant.helpers.discovery import async_load_platform
_LOGGER = logging.getLogger(__name__)
REQUIREMENTS = ['zm-py==0.3.1']
REQUIREMENTS = ['zm-py==0.3.3']
CONF_PATH_ZMS = 'path_zms'

View file

@ -2,7 +2,7 @@
"""Constants used by Home Assistant components."""
MAJOR_VERSION = 0
MINOR_VERSION = 87
PATCH_VERSION = '0'
PATCH_VERSION = '1'
__short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION)
__version__ = '{}.{}'.format(__short_version__, PATCH_VERSION)
REQUIRED_PYTHON_VER = (3, 5, 3)

View file

@ -1792,4 +1792,4 @@ zigpy-xbee==0.1.1
zigpy==0.2.0
# homeassistant.components.zoneminder
zm-py==0.3.1
zm-py==0.3.3