Use system zeroconf singleton for homekit (#35502)

Zeroconf instances are expensive so we share a single instance
instead of running multiple.
This commit is contained in:
J. Nick Koston 2020-05-11 13:21:16 -05:00 committed by GitHub
parent 48899c7a1c
commit 751529feca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 1 deletions

View file

@ -29,3 +29,10 @@ def events(hass):
EVENT_HOMEKIT_CHANGED, ha_callback(lambda e: events.append(e))
)
yield events
@pytest.fixture
def mock_zeroconf():
"""Mock zeroconf."""
with patch("homeassistant.components.zeroconf.HaZeroconf") as mock_zc:
yield mock_zc.return_value