From 632da318b1fd7a0064ff47b2a1859f25adc5b7c2 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 13 Nov 2018 23:09:19 +0100 Subject: [PATCH] Expanded Chromecast plugin --- platypush/plugins/media/chromecast.py | 50 +++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/platypush/plugins/media/chromecast.py b/platypush/plugins/media/chromecast.py index ae8c80d2..99530228 100644 --- a/platypush/plugins/media/chromecast.py +++ b/platypush/plugins/media/chromecast.py @@ -178,6 +178,56 @@ class MediaChromecastPlugin(Plugin): return None + @action + def play(self, chromecast=None): + return self.get_chromecast(chromecast or self.chromecast).play() + + + @action + def pause(self, chromecast=None): + return self.get_chromecast(chromecast or self.chromecast).pause() + + + @action + def stop(self, chromecast=None): + return self.get_chromecast(chromecast or self.chromecast).stop() + + + @action + def rewind(self, chromecast=None): + return self.get_chromecast(chromecast or self.chromecast).rewind() + + + @action + def seek(self, location, chromecast=None): + return self.get_chromecast(chromecast or self.chromecast).seek(location) + + + @action + def is_playing(self, chromecast=None): + return self.get_chromecast(chromecast or self.chromecast).is_playing + + + @action + def is_paused(self, chromecast=None): + return self.get_chromecast(chromecast or self.chromecast).is_paused + + + @action + def enable_subtitle(self, chromecast=None): + return self.get_chromecast(chromecast or self.chromecast).enable_subtitle + + + @action + def disable_subtitle(self, chromecast=None): + return self.get_chromecast(chromecast or self.chromecast).disable_subtitle + + + @action + def status(self, chromecast=None): + return self.get_chromecast(chromecast or self.chromecast).status + + @action def disconnect(self, chromecast=None, timeout=None, blocking=True): """