1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Playback on Sonos speakers from Plex integration (#36177)

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
jjlawren
2020-05-27 17:36:08 -05:00
committed by GitHub
parent 1e9ec917f6
commit 4e74fae615
10 changed files with 265 additions and 4 deletions

View File

@@ -69,6 +69,10 @@ class MockPlexAccount:
"""Mock the PlexAccount resources listing method."""
return self._resources
def sonos_speaker_by_id(self, machine_identifier):
"""Mock the PlexAccount Sonos lookup method."""
return MockPlexSonosClient(machine_identifier)
class MockPlexSystemAccount:
"""Mock a PlexSystemAccount instance."""
@@ -351,3 +355,15 @@ class MockPlexMediaTrack(MockPlexMediaItem):
"""Initialize the object."""
super().__init__(f"Track {index}", "track")
self.index = index
class MockPlexSonosClient:
"""Mock a PlexSonosClient instance."""
def __init__(self, machine_identifier):
"""Initialize the object."""
self.machineIdentifier = machine_identifier
def playMedia(self, item):
"""Mock the playMedia method."""
pass