mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 18:28:14 +02:00
Convert discovery helper to use dispatcher (#47008)
This commit is contained in:
@ -441,10 +441,14 @@ class TestSetup:
|
||||
"""Test all init work done till start."""
|
||||
call_order = []
|
||||
|
||||
def component1_setup(hass, config):
|
||||
async def component1_setup(hass, config):
|
||||
"""Set up mock component."""
|
||||
discovery.discover(hass, "test_component2", {}, "test_component2", {})
|
||||
discovery.discover(hass, "test_component3", {}, "test_component3", {})
|
||||
await discovery.async_discover(
|
||||
hass, "test_component2", {}, "test_component2", {}
|
||||
)
|
||||
await discovery.async_discover(
|
||||
hass, "test_component3", {}, "test_component3", {}
|
||||
)
|
||||
return True
|
||||
|
||||
def component_track_setup(hass, config):
|
||||
@ -453,7 +457,7 @@ class TestSetup:
|
||||
return True
|
||||
|
||||
mock_integration(
|
||||
self.hass, MockModule("test_component1", setup=component1_setup)
|
||||
self.hass, MockModule("test_component1", async_setup=component1_setup)
|
||||
)
|
||||
|
||||
mock_integration(
|
||||
|
Reference in New Issue
Block a user