Skip to main content

Sony Bravia API for controlling Sony Bravia Smart TV

Project description

Sony Bravia Smart TV Control API

This api uses the private rest api as well as the envelope api that processes the remote's iirc input.

Using this api is virtually the same as using the remote.

Installation

Install from pypi:

pip install sony-bravia-api==1.01

Download and install the latest release using pip:

pip3 install sony_bravia_api-1.01.tar.gz

Usage

### Import the module ###
from sony_bravia_api import Bravia

### Create your tv instance to be controlled ###
bravia = Bravia('<device_name>', '<ip_address>','http://<ip_address>/sony/', '<security_token>')

### Note: The security token is the token set in the ip control settings.

### Set TV Volume ###
### Takes an integer in the form of a string between 0 and 100 ###
bravia.setVol("10")

### Set TV Mute ###
### Takes a Boolean ###
bravia.setMute(True)

### Set Power ###
### Takes a Boolean ###
bravia.setPower(True)

### Set Active Input ###
### Takes the input type and it's number ###
bravia.setExtInput('hdmi', '1') ### Sets input to HDMI 1

### Get Power State ###
bravia.getPowerStatus() ### Returns power status,'active','inactive', and 'standby'

### Get Application list ###
bravia.getApplicationList() ### Returns the installed applications on the TV for use with the setActiveApplication function

### Set Active Application ###
bravia.setActiveApplication('netflix') ### Opens app

### Get Remote Info ###
bravia.getRemoteControllerInfo() ### Returns IIRC codes and remote status

### Play Button ###
bravia.play()

### Pause Button ###
bravia.pause()

### Home Button ###
bravia.home() ### Returns to tv home screen

### Back Button ###
bravia.back()

### Vol Up Button ###
bravia.volUp() ### Raises volume by 1

### Vol Down Button ###
bravia.volDown() ### Lowers volume by 1

### Mute Button ###
bravia.mute() ### Mutes the tv

### Power Button ###
bravia.power() ### Turns tv on or off

### Confirm Button ###
bravia.confirm()

### Next Button ###
bravia.next()

### Previous Button ###
bravia.prev()

### Rewind Button ###
bravia.rewind()

### Forward Button ###
bravia.forward()

### Up Button ###
bravia.up()

### Down Button ###
bravia.down()

### Left Button ###
bravia.left()

### Right Button ###
bravia.right()

### Exit Button ###
bravia.exit()



Project details


Release history Release notifications | RSS feed

This version

1.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sony_bravia_api-1.1.tar.gz (5.0 kB view details)

Uploaded Source

File details

Details for the file sony_bravia_api-1.1.tar.gz.

File metadata

  • Download URL: sony_bravia_api-1.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.10

File hashes

Hashes for sony_bravia_api-1.1.tar.gz
Algorithm Hash digest
SHA256 a38dc6f988186dcd7da7e93e4e2ede9715ce651fbb304435fae61f161f5d6ed3
MD5 7e4509ae20040bcd93c8a02316aae655
BLAKE2b-256 24cc535fc6b01af8333a1eba4ed1282af8ba36f7865b55e4fe4fe853cfc488e3

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