mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-08-18 19:26:57 +00:00
31 lines
703 B
Python
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})
|