Skip to main content

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

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


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.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bravia_tv-1.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file bravia_tv-1.0.tar.gz.

File metadata

  • Download URL: bravia_tv-1.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.6.9

File hashes

Hashes for bravia_tv-1.0.tar.gz
Algorithm Hash digest
SHA256 c874813c21fe31e09adc0e39988ccd958496b30a31c519c3984ae093e60c1fd6
MD5 b9f01f104605314f264fa9f5ad2a791d
BLAKE2b-256 93d81b46208ca0871e2971c5aa63d6e59d2c58dcc1da5c49ad00f0a6c14a159c

See more details on using hashes here.

File details

Details for the file bravia_tv-1.0-py3-none-any.whl.

File metadata

  • Download URL: bravia_tv-1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.6.9

File hashes

Hashes for bravia_tv-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d031b8b8ba1aff3b6517a1394f9eb609583bee2b7c3e9d44bc4d556a98608bec
MD5 41d2791399089d8c6059c83c0673ecd0
BLAKE2b-256 906ae9f7af78ac09514ca4a27d2aaa8577cb5715d0911c83eae0de2ad01239ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page