How to use the pychromecast.controllers.dashcast.DashCastController function in PyChromecast

To help you get started, we’ve selected a few PyChromecast examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github guirem / plugin-googlecast / resources / pychromecast / examples / dashcast_blocking.py View on Github external
import pychromecast
import pychromecast.controllers.dashcast as dashcast

debug = '--show-debug' in sys.argv
if debug:
    logging.basicConfig(level=logging.DEBUG)

casts = pychromecast.get_chromecasts()
if len(casts) == 0:
    print("No Devices Found")
    exit()

cast = casts[0]
cast.start()

d = dashcast.DashCastController()
cast.register_handler(d)

print()
print(cast.device)
time.sleep(1)
print()
print(cast.status)
print()
print(cast.media_controller.status)
print()

if not cast.is_idle:
    print("Killing current running app")
    cast.quit_app()
    time.sleep(5)
github balloob / pychromecast / examples / dashcast_blocking.py View on Github external
import pychromecast
import pychromecast.controllers.dashcast as dashcast

debug = '--show-debug' in sys.argv
if debug:
    logging.basicConfig(level=logging.DEBUG)

casts = pychromecast.get_chromecasts()
if len(casts) == 0:
    print("No Devices Found")
    exit()

cast = casts[0]
cast.start()

d = dashcast.DashCastController()
cast.register_handler(d)

print()
print(cast.device)
time.sleep(1)
print()
print(cast.status)
print()
print(cast.media_controller.status)
print()

if not cast.is_idle:
    print("Killing current running app")
    cast.quit_app()
    time.sleep(5)
github balloob / pychromecast / pychromecast / controllers / dashcast.py View on Github external
def __init__(self, appNamespace=APP_NAMESPACE, appId=APP_DASHCAST):
        super(DashCastController, self).__init__(appNamespace, appId)
github madmod / dashcast-docker / app.py View on Github external
def __init__(self, device, dashboard_url='https://home-assistant.io', dashboard_app_name='DashCast'):
        self.device = device
        print('DashboardLauncher', self.device.name)

        self.controller = dashcast.DashCastController()
        self.device.register_handler(self.controller)

        receiver_controller = device.socket_client.receiver_controller
        receiver_controller.register_status_listener(self)

        self.dashboard_url = dashboard_url
        self.dashboard_app_name = dashboard_app_name

        # Check status on init.
        self.new_cast_status(self.device.status)
        # Launch dashboard on init.
        while True:
            self.launch_dashboard()
            time.sleep(60)
github skorokithakis / catt / catt / controllers.py View on Github external
def __init__(self, cast, app, prep=None):
        self._controller = PyChromecastDashCastController()
        super(DashCastController, self).__init__(cast, app, prep=prep)