From 6c3ea2a904ab38afcb0de424592949ff2d26e99d Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 21 Apr 2020 22:46:19 -0500 Subject: [PATCH] Fix zeroconf interface being ineffective in HomeKit (#34516) --- homeassistant/components/homekit/__init__.py | 2 +- tests/components/homekit/test_homekit.py | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/homekit/__init__.py b/homeassistant/components/homekit/__init__.py index d114e02ef06..35620e9e11d 100644 --- a/homeassistant/components/homekit/__init__.py +++ b/homeassistant/components/homekit/__init__.py @@ -153,7 +153,7 @@ async def async_setup(hass, config): entity_filter = conf[CONF_FILTER] entity_config = conf[CONF_ENTITY_CONFIG] 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( diff --git a/tests/components/homekit/test_homekit.py b/tests/components/homekit/test_homekit.py index 30652f58924..7ba51106cb9 100644 --- a/tests/components/homekit/test_homekit.py +++ b/tests/components/homekit/test_homekit.py @@ -21,6 +21,7 @@ from homeassistant.components.homekit.const import ( BRIDGE_NAME, CONF_AUTO_START, CONF_SAFE_MODE, + CONF_ZEROCONF_DEFAULT_INTERFACE, DEFAULT_PORT, DEFAULT_SAFE_MODE, DOMAIN, @@ -97,6 +98,7 @@ async def test_setup_auto_start_disabled(hass): CONF_PORT: 11111, CONF_IP_ADDRESS: "172.0.0.0", 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) 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