You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
703 B

"""
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})

Powered by TurnKey Linux.