Fix zeroconf interface being ineffective in HomeKit (#34516)

This commit is contained in:
J. Nick Koston 2020-04-21 22:46:19 -05:00 committed by GitHub
parent 193e9bec97
commit 6c3ea2a904
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -153,7 +153,7 @@ async def async_setup(hass, config):
entity_filter = conf[CONF_FILTER] entity_filter = conf[CONF_FILTER]
entity_config = conf[CONF_ENTITY_CONFIG] entity_config = conf[CONF_ENTITY_CONFIG]
interface_choice = ( interface_choice = (
InterfaceChoice.Default if config.get(CONF_ZEROCONF_DEFAULT_INTERFACE) else None InterfaceChoice.Default if conf.get(CONF_ZEROCONF_DEFAULT_INTERFACE) else None
) )
homekit = HomeKit( homekit = HomeKit(

View File

@ -21,6 +21,7 @@ from homeassistant.components.homekit.const import (
BRIDGE_NAME, BRIDGE_NAME,
CONF_AUTO_START, CONF_AUTO_START,
CONF_SAFE_MODE, CONF_SAFE_MODE,
CONF_ZEROCONF_DEFAULT_INTERFACE,
DEFAULT_PORT, DEFAULT_PORT,
DEFAULT_SAFE_MODE, DEFAULT_SAFE_MODE,
DOMAIN, DOMAIN,
@ -97,6 +98,7 @@ async def test_setup_auto_start_disabled(hass):
CONF_PORT: 11111, CONF_PORT: 11111,
CONF_IP_ADDRESS: "172.0.0.0", CONF_IP_ADDRESS: "172.0.0.0",
CONF_SAFE_MODE: DEFAULT_SAFE_MODE, CONF_SAFE_MODE: DEFAULT_SAFE_MODE,
CONF_ZEROCONF_DEFAULT_INTERFACE: True,
} }
} }
@ -106,7 +108,15 @@ async def test_setup_auto_start_disabled(hass):
assert await setup.async_setup_component(hass, DOMAIN, config) assert await setup.async_setup_component(hass, DOMAIN, config)
mock_homekit.assert_any_call( mock_homekit.assert_any_call(
hass, "Test Name", 11111, "172.0.0.0", ANY, {}, DEFAULT_SAFE_MODE, None, None hass,
"Test Name",
11111,
"172.0.0.0",
ANY,
{},
DEFAULT_SAFE_MODE,
None,
InterfaceChoice.Default,
) )
assert mock_homekit().setup.called is True assert mock_homekit().setup.called is True