Python Bravia TV remote control
Project description
Python Bravia TV
Python Bravia TV is a Python library to perform remote communication via http protocol with Sony Bravia TVs 2013 and newer: list of tvs For more information on the api used in this library, refer to BRAVIA Professional Display Knowledge Center
This library is a fork of BraviaRC and is primarily being developed with the intent of supporting home-assistant
Installation
# Installing from PyPI
$ pip install bravia-tv
# Installing latest development
$ pip install \
git+https://github.com/dcnielsen90/python-bravia-tv@master
Initializing and Connecting
from bravia_tv import BraviaRC
ip_address = '192.178.1.2'
mac_address = "XX:XX:XX:XX:XX:XX"
# IP address is required. mac address is required
# to turn on TV
braviarc = BraviaRC(ip_address, mac_address)
# The pin can be a pre-shared key (PSK) or you can
# receive a pin from the tv by making the pin 0000
pin = '1878'
# Connect to TV
braviarc.connect(pin, 'my_device_id', 'my device name')
Command Examples
# Check connection
if braviarc.is_connected():
# Get power status
power_status = braviarc.get_power_status()
print (power_status)
# Get playing info
playing_content = braviarc.get_playing_info()
# Print current playing channel
print (playing_content.get('title'))
# Get volume info
volume_info = braviarc.get_volume_info()
# Print current volume
print (volume_info.get('volume'))
# Change channel
braviarc.play_content(uri)
# Get app list
app_info = braviarc.load_app_list()
print (app_info)
# Start a given app
braviarc.start_app("Netflix")
# Turn off the TV
braviarc.turn_off()
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
bravia_tv-1.0.1.tar.gz
(6.0 kB
view hashes)
Built Distribution
Close
Hashes for bravia_tv-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72a0f1618bb5ee57234e73ff0bc2e109d52d0977f2221b4e9094a03b2de9e8fd |
|
MD5 | 9a59a607bc50c225a1e030537ebc44ff |
|
BLAKE2b-256 | f802af9b9dc9f99b127bc39300f30168c9b92505e5b02ca217bec52a9d98545f |