Created
April 25, 2018 07:50
-
-
Save bazwilliams/8eaf7e02e4795bef38b35a8bcf093bb1 to your computer and use it in GitHub Desktop.
Python script to discover if a Sky Q box is in standby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
class SkyBox(object): | |
def __init__(self, addr): | |
self.addr = addr | |
self.port = 9006 | |
@property | |
def is_standby(self): | |
req = requests.get('http://%s:%s/as/system/information' % (self.addr, self.port)) | |
if req.status_code == 200: | |
info = req.json() | |
return info['activeStandby'] | |
skyBox = SkyBox('192.168.1.186') | |
print skyBox.is_standby |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment