beamer IP address out of scriptmaster
parent
14d6ef789a
commit
b02efa5861
6 changed files with 49 additions and 6 deletions
@ -0,0 +1,26 @@ |
||||
#!/usr/bin/env python2.7 |
||||
from __future__ import print_function |
||||
import time,sys,os |
||||
sys.path.append(os.path.dirname(__file__) + "/../pychromecast/") |
||||
import pychromecast |
||||
#mycastname=pychromecast.get_chromecasts_as_dict().keys()[0] |
||||
mycastname="Level2 Chillcast DVI1" |
||||
cast = pychromecast.get_chromecast(friendly_name=mycastname) |
||||
cast.wait() |
||||
print(cast.device.friendly_name) |
||||
offlinetime=0 |
||||
while True: |
||||
caststatus=cast.status.display_name |
||||
print(caststatus) |
||||
text_file = open("/var/run/caststatus", "w") |
||||
text_file.write("%s" % caststatus) |
||||
text_file.close() |
||||
if(caststatus == "Backdrop"): |
||||
offlinetime+=1 |
||||
else: |
||||
offlinetime=0 |
||||
if(offlinetime>10): |
||||
#print("Chromecast not streaming, switching to slideshow") |
||||
offlinetime=0 |
||||
time.sleep(10) |
||||
cast.quit_app() |
Loading…
Reference in new issue