Continuous discovery of Sonos speakers (#23484)
This commit is contained in:
1 parent
5529bcc114
commit
0ecf152153
3 files changed
+47
-30
No files matched your search
@@ -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