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. For more information on the api used in this library, refer to BRAVIA Professional Display Knowledge Center

This library was forked from 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.168.1.2'

# IP address is required. The active NIC's mac will be acquired dynamically
# if mac is left None.
braviarc = BraviaRC(ip_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")

    # Get scenes (video modes)
    scenes = braviarc.load_scene_list()
    print (scenes)

    # Get current scene (video mode)
    current_scene = braviarc.get_current_scene()
    print (current_scene)

    # Set scene (video mode) to 'Cinema'
    braviarc.set_scene('Cinema')

    # 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.8.tar.gz (6.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.8-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bravia_tv-1.0.8.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.5

File hashes

Hashes for bravia_tv-1.0.8.tar.gz
Algorithm Hash digest
SHA256 753ec5585b943fa9aa8c93170a2e5b0e33a1ba5999cead3d394d180f9a1335fb
MD5 74a1d84731321b948e4fd5f9d93a19d6
BLAKE2b-256 0c7cfa38b32b1c660134db31785da5a32f7e5efe6f73a6351fadd85437631a0d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bravia_tv-1.0.8-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.5

File hashes

Hashes for bravia_tv-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 fbc3b08a63bfbeb821a6f9502f7941d963fe1673be1824618994c5fcae6221aa
MD5 60d2732997de4806cff63d04fcdb13ef
BLAKE2b-256 9d4161f460a93016021039e3b697639ae09284425365b355fb6f34ea669c8215

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