Merge pull request #19505 from home-assistant/rc

0.84.6
This commit is contained in:
Paulus Schoutsen 2018-12-21 15:33:17 +01:00 committed by GitHub
commit 28abc30b4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 26 deletions

View File

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

View File

@ -1,10 +1,7 @@
"""Helpers for data entry flows for config entries."""
from functools import partial
from ipaddress import ip_address
from urllib.parse import urlparse
from homeassistant import config_entries
from homeassistant.util.network import is_local
def register_discovery_flow(domain, title, discovery_function,
@ -115,15 +112,6 @@ class WebhookFlowHandler(config_entries.ConfigFlow):
if not self._allow_multiple and self._async_current_entries():
return self.async_abort(reason='one_instance_allowed')
try:
url_parts = urlparse(self.hass.config.api.base_url)
if is_local(ip_address(url_parts.hostname)):
return self.async_abort(reason='not_internet_accessible')
except ValueError:
# If it's not an IP address, it's very likely publicly accessible
pass
if user_input is None:
return self.async_show_form(
step_id='user',

View File

@ -183,19 +183,6 @@ async def test_webhook_multiple_entries_allowed(hass, webhook_flow_conf):
assert result['type'] == data_entry_flow.RESULT_TYPE_FORM
async def test_webhook_config_flow_aborts_external_url(hass,
webhook_flow_conf):
"""Test configuring a webhook without an external url."""
flow = config_entries.HANDLERS['test_single']()
flow.hass = hass
hass.config.api = Mock(base_url='http://192.168.1.10')
result = await flow.async_step_user()
assert result['type'] == data_entry_flow.RESULT_TYPE_ABORT
assert result['reason'] == 'not_internet_accessible'
async def test_webhook_config_flow_registers_webhook(hass, webhook_flow_conf):
"""Test setting up an entry creates a webhook."""
flow = config_entries.HANDLERS['test_single']()