diff --git a/homeassistant/helpers/config_entry_flow.py b/homeassistant/helpers/config_entry_flow.py index 31d9907d315..8f5705bc67a 100644 --- a/homeassistant/helpers/config_entry_flow.py +++ b/homeassistant/helpers/config_entry_flow.py @@ -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', diff --git a/tests/helpers/test_config_entry_flow.py b/tests/helpers/test_config_entry_flow.py index 8e38f76f1c0..846c2cd1560 100644 --- a/tests/helpers/test_config_entry_flow.py +++ b/tests/helpers/test_config_entry_flow.py @@ -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']()