mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Refactor zeroconf setup to be async (#39955)
* Refactor zeroconf setup to be async Most of the setup was calling back to async because we were setting up listeners. Since we only need to jump into the executor to create the zeroconf instance, its much faster to setup in async. In testing this cut the setup time in half or better. * partial revert to after_deps
This commit is contained in:
@@ -395,6 +395,13 @@ async def mqtt_mock(hass, mqtt_client_mock, mqtt_config):
|
||||
return component
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_zeroconf():
|
||||
"""Mock zeroconf."""
|
||||
with patch("homeassistant.components.zeroconf.HaZeroconf") as mock_zc:
|
||||
yield mock_zc.return_value
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def legacy_patchable_time():
|
||||
"""Allow time to be patchable by using event listeners instead of asyncio loop."""
|
||||
|
||||
Reference in New Issue
Block a user