Merge pull request #12742 from home-assistant/release-0-64-1

0.64.1
This commit is contained in:
Paulus Schoutsen 2018-02-27 11:24:37 -08:00 committed by GitHub
commit 88b7f429c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 98 additions and 52 deletions

View File

@ -99,6 +99,6 @@ class DeconzBinarySensor(BinarySensorDevice):
attr = { attr = {
ATTR_BATTERY_LEVEL: self._sensor.battery, ATTR_BATTERY_LEVEL: self._sensor.battery,
} }
if self._sensor.type == PRESENCE: if self._sensor.type in PRESENCE:
attr['dark'] = self._sensor.dark attr['dark'] = self._sensor.dark
return attr return attr

View File

@ -14,7 +14,9 @@ import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.discovery import load_platform from homeassistant.helpers.discovery import load_platform
from homeassistant.util import Throttle from homeassistant.util import Throttle
REQUIREMENTS = ['coinbase==2.0.7'] REQUIREMENTS = [
'https://github.com/balloob/coinbase-python/archive/'
'3a35efe13ef728a1cc18204b4f25be1fcb1c6006.zip#coinbase==2.0.8a1']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View File

@ -13,6 +13,7 @@ import voluptuous as vol
from homeassistant.components.discovery import SERVICE_DECONZ from homeassistant.components.discovery import SERVICE_DECONZ
from homeassistant.const import ( from homeassistant.const import (
CONF_API_KEY, CONF_HOST, CONF_PORT, EVENT_HOMEASSISTANT_STOP) CONF_API_KEY, CONF_HOST, CONF_PORT, EVENT_HOMEASSISTANT_STOP)
from homeassistant.core import callback
from homeassistant.helpers import config_validation as cv from homeassistant.helpers import config_validation as cv
from homeassistant.helpers import discovery from homeassistant.helpers import discovery
from homeassistant.helpers.aiohttp_client import async_get_clientsession from homeassistant.helpers.aiohttp_client import async_get_clientsession
@ -143,7 +144,18 @@ def async_setup_deconz(hass, config, deconz_config):
hass.services.async_register( hass.services.async_register(
DOMAIN, 'configure', async_configure, schema=SERVICE_SCHEMA) DOMAIN, 'configure', async_configure, schema=SERVICE_SCHEMA)
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, deconz.close) @callback
def deconz_shutdown(event):
"""
Wrap the call to deconz.close.
Used as an argument to EventBus.async_listen_once - EventBus calls
this method with the event as the first argument, which should not
be passed on to deconz.close.
"""
deconz.close()
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, deconz_shutdown)
return True return True

View File

@ -23,7 +23,7 @@ from homeassistant.const import CONF_NAME, EVENT_THEMES_UPDATED
from homeassistant.core import callback from homeassistant.core import callback
from homeassistant.loader import bind_hass from homeassistant.loader import bind_hass
REQUIREMENTS = ['home-assistant-frontend==20180221.1', 'user-agents==1.1.0'] REQUIREMENTS = ['home-assistant-frontend==20180227.0', 'user-agents==1.1.0']
DOMAIN = 'frontend' DOMAIN = 'frontend'
DEPENDENCIES = ['api', 'websocket_api', 'http', 'system_log'] DEPENDENCIES = ['api', 'websocket_api', 'http', 'system_log']

View File

@ -17,7 +17,7 @@ from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PORT
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
import homeassistant.util.color as color_util import homeassistant.util.color as color_util
REQUIREMENTS = ['iglo==1.2.5'] REQUIREMENTS = ['iglo==1.2.6']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@ -56,13 +56,13 @@ class IGloLamp(Light):
@property @property
def brightness(self): def brightness(self):
"""Return the brightness of this light between 0..255.""" """Return the brightness of this light between 0..255."""
return int((self._lamp.state['brightness'] / 200.0) * 255) return int((self._lamp.state()['brightness'] / 200.0) * 255)
@property @property
def color_temp(self): def color_temp(self):
"""Return the color temperature.""" """Return the color temperature."""
return color_util.color_temperature_kelvin_to_mired( return color_util.color_temperature_kelvin_to_mired(
self._lamp.state['white']) self._lamp.state()['white'])
@property @property
def min_mireds(self): def min_mireds(self):
@ -79,12 +79,12 @@ class IGloLamp(Light):
@property @property
def rgb_color(self): def rgb_color(self):
"""Return the RGB value.""" """Return the RGB value."""
return self._lamp.state['rgb'] return self._lamp.state()['rgb']
@property @property
def effect(self): def effect(self):
"""Return the current effect.""" """Return the current effect."""
return self._lamp.state['effect'] return self._lamp.state()['effect']
@property @property
def effect_list(self): def effect_list(self):
@ -100,7 +100,7 @@ class IGloLamp(Light):
@property @property
def is_on(self): def is_on(self):
"""Return true if light is on.""" """Return true if light is on."""
return self._lamp.state['on'] return self._lamp.state()['on']
def turn_on(self, **kwargs): def turn_on(self, **kwargs):
"""Turn the light on.""" """Turn the light on."""

View File

@ -8,9 +8,11 @@ https://home-assistant.io/components/media_player.cast/
import asyncio import asyncio
import logging import logging
import threading import threading
import functools
import voluptuous as vol import voluptuous as vol
from homeassistant.exceptions import PlatformNotReady
from homeassistant.helpers.typing import HomeAssistantType, ConfigType from homeassistant.helpers.typing import HomeAssistantType, ConfigType
from homeassistant.core import callback from homeassistant.core import callback
from homeassistant.helpers.dispatcher import (dispatcher_send, from homeassistant.helpers.dispatcher import (dispatcher_send,
@ -34,6 +36,7 @@ CONF_IGNORE_CEC = 'ignore_cec'
CAST_SPLASH = 'https://home-assistant.io/images/cast/splash.png' CAST_SPLASH = 'https://home-assistant.io/images/cast/splash.png'
DEFAULT_PORT = 8009 DEFAULT_PORT = 8009
SOCKET_CLIENT_RETRIES = 10
SUPPORT_CAST = SUPPORT_PAUSE | SUPPORT_VOLUME_SET | SUPPORT_VOLUME_MUTE | \ SUPPORT_CAST = SUPPORT_PAUSE | SUPPORT_VOLUME_SET | SUPPORT_VOLUME_MUTE | \
SUPPORT_TURN_ON | SUPPORT_TURN_OFF | SUPPORT_PREVIOUS_TRACK | \ SUPPORT_TURN_ON | SUPPORT_TURN_OFF | SUPPORT_PREVIOUS_TRACK | \
@ -76,7 +79,7 @@ def _setup_internal_discovery(hass: HomeAssistantType) -> None:
try: try:
# pylint: disable=protected-access # pylint: disable=protected-access
chromecast = pychromecast._get_chromecast_from_host( chromecast = pychromecast._get_chromecast_from_host(
mdns, blocking=True) mdns, blocking=True, tries=SOCKET_CLIENT_RETRIES)
except pychromecast.ChromecastConnectionError: except pychromecast.ChromecastConnectionError:
_LOGGER.debug("Can't set up cast with mDNS info %s. " _LOGGER.debug("Can't set up cast with mDNS info %s. "
"Assuming it's not a Chromecast", mdns) "Assuming it's not a Chromecast", mdns)
@ -182,11 +185,13 @@ def async_setup_platform(hass: HomeAssistantType, config: ConfigType,
else: else:
# Manually add a "normal" Chromecast, we can do that without discovery. # Manually add a "normal" Chromecast, we can do that without discovery.
try: try:
chromecast = yield from hass.async_add_job( func = functools.partial(pychromecast.Chromecast, *want_host,
pychromecast.Chromecast, *want_host) tries=SOCKET_CLIENT_RETRIES)
except pychromecast.ChromecastConnectionError: chromecast = yield from hass.async_add_job(func)
_LOGGER.warning("Can't set up chromecast on %s", want_host[0]) except pychromecast.ChromecastConnectionError as err:
raise _LOGGER.warning("Can't set up chromecast on %s: %s",
want_host[0], err)
raise PlatformNotReady
key = (chromecast.host, chromecast.port, chromecast.uuid) key = (chromecast.host, chromecast.port, chromecast.uuid)
cast_device = _async_create_cast_device(hass, chromecast) cast_device = _async_create_cast_device(hass, chromecast)
if cast_device is not None: if cast_device is not None:

View File

@ -20,7 +20,7 @@ from homeassistant.const import (
CONF_NAME, STATE_ON, CONF_ZONE, CONF_TIMEOUT) CONF_NAME, STATE_ON, CONF_ZONE, CONF_TIMEOUT)
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
REQUIREMENTS = ['denonavr==0.6.0'] REQUIREMENTS = ['denonavr==0.6.1']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View File

@ -588,7 +588,7 @@ class MQTT(object):
def _mqtt_on_message(self, _mqttc, _userdata, msg): def _mqtt_on_message(self, _mqttc, _userdata, msg):
"""Message received callback.""" """Message received callback."""
self.hass.async_add_job(self._mqtt_handle_message, msg) self.hass.add_job(self._mqtt_handle_message, msg)
@callback @callback
def _mqtt_handle_message(self, msg): def _mqtt_handle_message(self, msg):

View File

@ -152,10 +152,8 @@ CONFIG_SCHEMA = vol.Schema({
vol.Optional(CONF_BAUD_RATE, default=DEFAULT_BAUD_RATE): vol.Optional(CONF_BAUD_RATE, default=DEFAULT_BAUD_RATE):
cv.positive_int, cv.positive_int,
vol.Optional(CONF_TCP_PORT, default=DEFAULT_TCP_PORT): cv.port, vol.Optional(CONF_TCP_PORT, default=DEFAULT_TCP_PORT): cv.port,
vol.Optional(CONF_TOPIC_IN_PREFIX, default=''): vol.Optional(CONF_TOPIC_IN_PREFIX): valid_subscribe_topic,
valid_subscribe_topic, vol.Optional(CONF_TOPIC_OUT_PREFIX): valid_publish_topic,
vol.Optional(CONF_TOPIC_OUT_PREFIX, default=''):
valid_publish_topic,
vol.Optional(CONF_NODES, default={}): NODE_SCHEMA, vol.Optional(CONF_NODES, default={}): NODE_SCHEMA,
}] }]
), ),
@ -358,8 +356,8 @@ def setup(hass, config):
hass.config.path('mysensors{}.pickle'.format(index + 1))) hass.config.path('mysensors{}.pickle'.format(index + 1)))
baud_rate = gway.get(CONF_BAUD_RATE) baud_rate = gway.get(CONF_BAUD_RATE)
tcp_port = gway.get(CONF_TCP_PORT) tcp_port = gway.get(CONF_TCP_PORT)
in_prefix = gway.get(CONF_TOPIC_IN_PREFIX) in_prefix = gway.get(CONF_TOPIC_IN_PREFIX, '')
out_prefix = gway.get(CONF_TOPIC_OUT_PREFIX) out_prefix = gway.get(CONF_TOPIC_OUT_PREFIX, '')
ready_gateway = setup_gateway( ready_gateway = setup_gateway(
device, persistence_file, baud_rate, tcp_port, in_prefix, device, persistence_file, baud_rate, tcp_port, in_prefix,
out_prefix) out_prefix)

View File

@ -31,7 +31,7 @@ CONF_DEVICE_CACHE = 'harmony_device_cache'
SERVICE_SYNC = 'harmony_sync' SERVICE_SYNC = 'harmony_sync'
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(ATTR_ACTIVITY): cv.string, vol.Optional(ATTR_ACTIVITY): cv.string,
vol.Required(CONF_NAME): cv.string, vol.Required(CONF_NAME): cv.string,
vol.Optional(ATTR_DELAY_SECS, default=DEFAULT_DELAY_SECS): vol.Optional(ATTR_DELAY_SECS, default=DEFAULT_DELAY_SECS):
vol.Coerce(float), vol.Coerce(float),
@ -71,7 +71,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
port) port)
# Ignore hub name when checking if this hub is known - ip and port only # Ignore hub name when checking if this hub is known - ip and port only
if host and host[1:] in (h.host for h in DEVICES): if host[1:] in ((h.host, h.port) for h in DEVICES):
_LOGGER.debug("Discovered host already known: %s", host) _LOGGER.debug("Discovered host already known: %s", host)
return return
elif CONF_HOST in config: elif CONF_HOST in config:
@ -139,7 +139,7 @@ class HarmonyRemote(remote.RemoteDevice):
_LOGGER.debug("HarmonyRemote device init started for: %s", name) _LOGGER.debug("HarmonyRemote device init started for: %s", name)
self._name = name self._name = name
self.host = host self.host = host
self._port = port self.port = port
self._state = None self._state = None
self._current_activity = None self._current_activity = None
self._default_activity = activity self._default_activity = activity

View File

@ -70,8 +70,8 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
from alpha_vantage.foreignexchange import ForeignExchange from alpha_vantage.foreignexchange import ForeignExchange
api_key = config.get(CONF_API_KEY) api_key = config.get(CONF_API_KEY)
symbols = config.get(CONF_SYMBOLS) symbols = config.get(CONF_SYMBOLS, [])
conversions = config.get(CONF_FOREIGN_EXCHANGE) conversions = config.get(CONF_FOREIGN_EXCHANGE, [])
if not symbols and not conversions: if not symbols and not conversions:
msg = 'Warning: No symbols or currencies configured.' msg = 'Warning: No symbols or currencies configured.'

View File

@ -19,7 +19,9 @@ from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle from homeassistant.util import Throttle
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
REQUIREMENTS = ['broadlink==0.5'] REQUIREMENTS = [
'https://github.com/balloob/python-broadlink/archive/'
'3580ff2eaccd267846f14246d6ede6e30671f7c6.zip#broadlink==0.5.1']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View File

@ -22,7 +22,9 @@ import homeassistant.helpers.config_validation as cv
from homeassistant.util import Throttle from homeassistant.util import Throttle
from homeassistant.util.dt import utcnow from homeassistant.util.dt import utcnow
REQUIREMENTS = ['broadlink==0.5'] REQUIREMENTS = [
'https://github.com/balloob/python-broadlink/archive/'
'3580ff2eaccd267846f14246d6ede6e30671f7c6.zip#broadlink==0.5.1']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View File

@ -14,7 +14,7 @@ from homeassistant.helpers import discovery
from homeassistant.helpers import config_validation as cv from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity import Entity
REQUIREMENTS = ['tahoma-api==0.0.12'] REQUIREMENTS = ['tahoma-api==0.0.13']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View File

@ -8,12 +8,15 @@ import asyncio
import logging import logging
import voluptuous as vol import voluptuous as vol
import async_timeout
from homeassistant.components.vacuum import ( from homeassistant.components.vacuum import (
VacuumDevice, PLATFORM_SCHEMA, SUPPORT_BATTERY, SUPPORT_FAN_SPEED, VacuumDevice, PLATFORM_SCHEMA, SUPPORT_BATTERY, SUPPORT_FAN_SPEED,
SUPPORT_PAUSE, SUPPORT_RETURN_HOME, SUPPORT_SEND_COMMAND, SUPPORT_STATUS, SUPPORT_PAUSE, SUPPORT_RETURN_HOME, SUPPORT_SEND_COMMAND, SUPPORT_STATUS,
SUPPORT_STOP, SUPPORT_TURN_OFF, SUPPORT_TURN_ON) SUPPORT_STOP, SUPPORT_TURN_OFF, SUPPORT_TURN_ON)
from homeassistant.const import ( from homeassistant.const import (
CONF_HOST, CONF_NAME, CONF_PASSWORD, CONF_USERNAME) CONF_HOST, CONF_NAME, CONF_PASSWORD, CONF_USERNAME)
from homeassistant.exceptions import PlatformNotReady
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
@ -90,7 +93,13 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
) )
_LOGGER.info("Initializing communication with host %s (username: %s)", _LOGGER.info("Initializing communication with host %s (username: %s)",
host, username) host, username)
yield from hass.async_add_job(roomba.connect)
try:
with async_timeout.timeout(9):
yield from hass.async_add_job(roomba.connect)
except asyncio.TimeoutError:
raise PlatformNotReady
roomba_vac = RoombaVacuum(name, roomba) roomba_vac = RoombaVacuum(name, roomba)
hass.data[PLATFORM][host] = roomba_vac hass.data[PLATFORM][host] = roomba_vac

View File

@ -96,7 +96,7 @@ class DarkSkyWeather(WeatherEntity):
@property @property
def humidity(self): def humidity(self):
"""Return the humidity.""" """Return the humidity."""
return self._ds_currently.get('humidity') * 100.0 return round(self._ds_currently.get('humidity') * 100.0, 2)
@property @property
def wind_speed(self): def wind_speed(self):

View File

@ -17,8 +17,8 @@ from homeassistant.helpers import discovery, entity
from homeassistant.util import slugify from homeassistant.util import slugify
REQUIREMENTS = [ REQUIREMENTS = [
'bellows==0.5.0', 'bellows==0.5.1',
'zigpy==0.0.1', 'zigpy==0.0.3',
'zigpy-xbee==0.0.2', 'zigpy-xbee==0.0.2',
] ]

View File

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

View File

@ -15,3 +15,6 @@ attrs==17.4.0
# Breaks Python 3.6 and is not needed for our supported Python versions # Breaks Python 3.6 and is not needed for our supported Python versions
enum34==1000000000.0.0 enum34==1000000000.0.0
# This is a old unmaintained library and is replaced with pycryptodome
pycrypto==1000000000.0.0

View File

@ -133,7 +133,7 @@ batinfo==0.4.2
beautifulsoup4==4.6.0 beautifulsoup4==4.6.0
# homeassistant.components.zha # homeassistant.components.zha
bellows==0.5.0 bellows==0.5.1
# homeassistant.components.bmw_connected_drive # homeassistant.components.bmw_connected_drive
bimmer_connected==0.3.0 bimmer_connected==0.3.0
@ -165,10 +165,6 @@ boto3==1.4.7
# homeassistant.scripts.credstash # homeassistant.scripts.credstash
botocore==1.7.34 botocore==1.7.34
# homeassistant.components.sensor.broadlink
# homeassistant.components.switch.broadlink
broadlink==0.5
# homeassistant.components.sensor.buienradar # homeassistant.components.sensor.buienradar
# homeassistant.components.weather.buienradar # homeassistant.components.weather.buienradar
buienradar==0.91 buienradar==0.91
@ -179,9 +175,6 @@ caldav==0.5.0
# homeassistant.components.notify.ciscospark # homeassistant.components.notify.ciscospark
ciscosparkapi==0.4.2 ciscosparkapi==0.4.2
# homeassistant.components.coinbase
coinbase==2.0.7
# homeassistant.components.sensor.coinmarketcap # homeassistant.components.sensor.coinmarketcap
coinmarketcap==4.2.1 coinmarketcap==4.2.1
@ -219,7 +212,7 @@ defusedxml==0.5.0
deluge-client==1.0.5 deluge-client==1.0.5
# homeassistant.components.media_player.denonavr # homeassistant.components.media_player.denonavr
denonavr==0.6.0 denonavr==0.6.1
# homeassistant.components.media_player.directv # homeassistant.components.media_player.directv
directpy==0.2 directpy==0.2
@ -356,7 +349,7 @@ hipnotify==1.0.8
holidays==0.9.3 holidays==0.9.3
# homeassistant.components.frontend # homeassistant.components.frontend
home-assistant-frontend==20180221.1 home-assistant-frontend==20180227.0
# homeassistant.components.camera.onvif # homeassistant.components.camera.onvif
http://github.com/tgaugry/suds-passworddigest-py3/archive/86fc50e39b4d2b8997481967d6a7fe1c57118999.zip#suds-passworddigest-py3==0.1.2a http://github.com/tgaugry/suds-passworddigest-py3/archive/86fc50e39b4d2b8997481967d6a7fe1c57118999.zip#suds-passworddigest-py3==0.1.2a
@ -370,6 +363,13 @@ httplib2==0.10.3
# homeassistant.components.media_player.braviatv # homeassistant.components.media_player.braviatv
https://github.com/aparraga/braviarc/archive/0.3.7.zip#braviarc==0.3.7 https://github.com/aparraga/braviarc/archive/0.3.7.zip#braviarc==0.3.7
# homeassistant.components.coinbase
https://github.com/balloob/coinbase-python/archive/3a35efe13ef728a1cc18204b4f25be1fcb1c6006.zip#coinbase==2.0.8a1
# homeassistant.components.sensor.broadlink
# homeassistant.components.switch.broadlink
https://github.com/balloob/python-broadlink/archive/3580ff2eaccd267846f14246d6ede6e30671f7c6.zip#broadlink==0.5.1
# homeassistant.components.media_player.spotify # homeassistant.components.media_player.spotify
https://github.com/happyleavesaoc/spotipy/archive/544614f4b1d508201d363e84e871f86c90aa26b2.zip#spotipy==2.4.4 https://github.com/happyleavesaoc/spotipy/archive/544614f4b1d508201d363e84e871f86c90aa26b2.zip#spotipy==2.4.4
@ -400,7 +400,7 @@ https://github.com/wokar/pylgnetcast/archive/v0.2.0.zip#pylgnetcast==0.2.0
# i2csense==0.0.4 # i2csense==0.0.4
# homeassistant.components.light.iglo # homeassistant.components.light.iglo
iglo==1.2.5 iglo==1.2.6
# homeassistant.components.ihc # homeassistant.components.ihc
ihcsdk==2.1.1 ihcsdk==2.1.1
@ -1156,7 +1156,7 @@ steamodd==4.21
suds-py3==1.3.3.0 suds-py3==1.3.3.0
# homeassistant.components.tahoma # homeassistant.components.tahoma
tahoma-api==0.0.12 tahoma-api==0.0.13
# homeassistant.components.sensor.tank_utility # homeassistant.components.sensor.tank_utility
tank_utility==1.4.0 tank_utility==1.4.0
@ -1298,4 +1298,4 @@ ziggo-mediabox-xl==1.0.0
zigpy-xbee==0.0.2 zigpy-xbee==0.0.2
# homeassistant.components.zha # homeassistant.components.zha
zigpy==0.0.1 zigpy==0.0.3

View File

@ -75,7 +75,7 @@ hbmqtt==0.9.1
holidays==0.9.3 holidays==0.9.3
# homeassistant.components.frontend # homeassistant.components.frontend
home-assistant-frontend==20180221.1 home-assistant-frontend==20180227.0
# homeassistant.components.influxdb # homeassistant.components.influxdb
# homeassistant.components.sensor.influxdb # homeassistant.components.sensor.influxdb

View File

@ -113,6 +113,9 @@ CONSTRAINT_PATH = os.path.join(os.path.dirname(__file__),
CONSTRAINT_BASE = """ CONSTRAINT_BASE = """
# Breaks Python 3.6 and is not needed for our supported Python versions # Breaks Python 3.6 and is not needed for our supported Python versions
enum34==1000000000.0.0 enum34==1000000000.0.0
# This is a old unmaintained library and is replaced with pycryptodome
pycrypto==1000000000.0.0
""" """

View File

@ -7,6 +7,7 @@ from uuid import UUID
import pytest import pytest
from homeassistant.exceptions import PlatformNotReady
from homeassistant.const import EVENT_HOMEASSISTANT_STOP from homeassistant.const import EVENT_HOMEASSISTANT_STOP
from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.components.media_player import cast from homeassistant.components.media_player import cast
@ -122,7 +123,7 @@ def test_internal_discovery_callback_only_generates_once(hass):
return_value=chromecast) as gen_chromecast: return_value=chromecast) as gen_chromecast:
discover_cast('the-service', chromecast) discover_cast('the-service', chromecast)
mdns = (chromecast.host, chromecast.port, chromecast.uuid, None, None) mdns = (chromecast.host, chromecast.port, chromecast.uuid, None, None)
gen_chromecast.assert_called_once_with(mdns, blocking=True) gen_chromecast.assert_called_once_with(mdns, blocking=True, tries=10)
discover_cast('the-service', chromecast) discover_cast('the-service', chromecast)
gen_chromecast.reset_mock() gen_chromecast.reset_mock()
@ -196,6 +197,10 @@ def test_create_cast_device_with_uuid(hass):
@asyncio.coroutine @asyncio.coroutine
def test_normal_chromecast_not_starting_discovery(hass): def test_normal_chromecast_not_starting_discovery(hass):
"""Test cast platform not starting discovery when not required.""" """Test cast platform not starting discovery when not required."""
import pychromecast # imports mock pychromecast
pychromecast.ChromecastConnectionError = IOError
chromecast = get_fake_chromecast() chromecast = get_fake_chromecast()
with patch('pychromecast.Chromecast', return_value=chromecast): with patch('pychromecast.Chromecast', return_value=chromecast):
@ -216,6 +221,11 @@ def test_normal_chromecast_not_starting_discovery(hass):
hass, discovery_info={'host': 'host1', 'port': 42}) hass, discovery_info={'host': 'host1', 'port': 42})
assert add_devices.call_count == 0 assert add_devices.call_count == 0
with patch('pychromecast.Chromecast',
side_effect=pychromecast.ChromecastConnectionError):
with pytest.raises(PlatformNotReady):
yield from async_setup_cast(hass, {'host': 'host3'})
@asyncio.coroutine @asyncio.coroutine
def test_replay_past_chromecasts(hass): def test_replay_past_chromecasts(hass):