Skip to content

Instantly share code, notes, and snippets.

@bazwilliams
Created April 25, 2018 07:50
Show Gist options
  • Save bazwilliams/8eaf7e02e4795bef38b35a8bcf093bb1 to your computer and use it in GitHub Desktop.
Save bazwilliams/8eaf7e02e4795bef38b35a8bcf093bb1 to your computer and use it in GitHub Desktop.
Python script to discover if a Sky Q box is in standby
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