A python library to control a Sky Q Box
Project description
A Python library for controlling a SkyQ Box.
Installing
To install:
pip install pyskyq
Usage
There are currently three main capabilities provided by the library.
Logging and reacting to status changes on the box
Here is how to set up an event listener that can be polled for box status changes.
from pyskyq import Status
stat = Status('1.2.3.4') # replace with hostname / IP of your Sky box
stat.create_event_listener() # set up listener thread.
# do other stuff.
# standby property will be updated asynchronously when the box is turned on or off.
if stat.standby:
print('The SkyQ Box is in Standby Mode')
else:
print('The SkyQ Box is in Online Mode')
stat.shudown_event_listener() # shut down listener thread.
Loading and interrogating channel data
Getting access to channel data requires initialising an EPG object. Once this is done, you need to load the channel data from the box using the EPG.load_skyq_channel_data() method.
To access this data use EPG.get_channel(). See the method’s documentation for the full list of available attributes.
from pyskyq import EPG
epg = EPG(('1.2.3.4') # replace with hostname / IP of your Sky box
epg.load_skyq_channel_data() # load channel listing from Box.
sleep(5) # as above method is non-blocking
print(epg.get_channel(2002).desc) # print out the description of channel with sid = 2002
Documentation
Please refer to the documentation at https://pyskyq.readthedocs.io/.
Contributions
Contributions are welcome. Please fork the project on GitLab Not GitHub and raise an issue and merge request there.
Credits
Code and ideas obtained from:
Thank you to those individuals for their contributions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pyskyq-0.4.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fd4db726e78fd41496a204e018f71683c4e56f7595deff6a1f5e6514ebcc06c |
|
MD5 | da2c65714cc6e927bb7aad1ea03ad6cf |
|
BLAKE2b-256 | 9a81d4aec150f8740d8e5ca16c48f0474e793aad9f074a1644a395c56c60d930 |