1
0
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:
Anders Melchiorsen
2019-04-29 10:20:09 +02:00
committed by Pascal Vizeli
parent 5529bcc114
commit 0ecf152153
3 changed files with 47 additions and 30 deletions

View File

@@ -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