Skip to content

Instantly share code, notes, and snippets.

@leroix
Created April 3, 2015 04:32
Show Gist options
  • Save leroix/6ecdb25771481f784d40 to your computer and use it in GitHub Desktop.
Save leroix/6ecdb25771481f784d40 to your computer and use it in GitHub Desktop.
#! /usr/bin/env python
import sys
import time
import pychromecast
requested_volume = float(sys.argv[1]) if len(sys.argv) > 1 else None
cast = pychromecast.get_chromecast(friendly_name="Roo's Chromecast")
time.sleep(0.5)
if requested_volume != None:
cast.set_volume(requested_volume)
else:
print cast.status.volume_level
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment