Advertisement
Guest User

Untitled

a guest
Jul 4th, 2015
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. """
  2. Example that shows how the new Python 2 socket client can be used.
  3. """
  4.  
  5. from __future__ import print_function
  6. import time
  7. import sys
  8. import logging
  9.  
  10. import pychromecast
  11. import pychromecast.controllers.youtube as youtube
  12. import pychromecast.controllers.syno_audio as audiocontroller
  13.  
  14. #if '--show-debug' in sys.argv:
  15. logging.basicConfig(level=logging.DEBUG)
  16.  
  17. cast = pychromecast.get_chromecast()
  18.  
  19. dsaudio = audiocontroller.DSAudioController()
  20. cast.register_handler(dsaudio)
  21.  
  22. print()
  23. print(cast.device)
  24. time.sleep(1)
  25. print()
  26. print(cast.status)
  27. print()
  28.  
  29. print("Media status", cast.media_controller.status)
  30. print()
  31.  
  32. #first make sure that we are allowed to talk
  33. dsaudio.send_identify()
  34.  
  35. time.sleep(5)
  36. print("Sending pause command")
  37. dsaudio.pause()
  38. time.sleep(10)
  39. print("Sending play command")
  40. dsaudio.play()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement