mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Continuous discovery of Sonos speakers (#23484)
This commit is contained in:
committed by
Pascal Vizeli
parent
5529bcc114
commit
0ecf152153
@@ -35,8 +35,10 @@ def soco_fixture(music_library, speaker_info, dummy_soco_service):
|
||||
@pytest.fixture(name="discover")
|
||||
def discover_fixture(soco):
|
||||
"""Create a mock pysonos discover fixture."""
|
||||
with patch('pysonos.discover') as mock:
|
||||
mock.return_value = {soco}
|
||||
def do_callback(callback, **kwargs):
|
||||
callback(soco)
|
||||
|
||||
with patch('pysonos.discover_thread', side_effect=do_callback) as mock:
|
||||
yield mock
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user