Files
Home-AssistantConfig/deps/pychromecast/controllers/plex.py
2016-10-11 16:42:06 +00:00

31 lines
703 B
Python

"""
Controller to interface with the Plex-app.
"""
from . import BaseController
MESSAGE_TYPE = 'type'
TYPE_PLAY = "PLAY"
TYPE_PAUSE = "PAUSE"
TYPE_STOP = "STOP"
class PlexController(BaseController):
""" Controller to interact with Plex namespace. """
def __init__(self):
super(PlexController, self).__init__(
"urn:x-cast:plex", "9AC194DC")
def stop(self):
""" Send stop command. """
self.send_message({MESSAGE_TYPE: TYPE_STOP})
def pause(self):
""" Send pause command. """
self.send_message({MESSAGE_TYPE: TYPE_PAUSE})
def play(self):
""" Send play command. """
self.send_message({MESSAGE_TYPE: TYPE_PLAY})