Giter Club home page Giter Club logo

py-sony-bravia-remote's Introduction

https://scrutinizer-ci.com/g/Photonios/py-sony-bravia-remote/badges/build.png https://scrutinizer-ci.com/g/Photonios/py-sony-bravia-remote/badges/quality-score.png

py-sony-bravia-remote is a Python 3 library for interfacing remotely with Sony Bravia TV's. It utilizes a undocumented HTTP API that the TV exposes. This allows you to control things like changing the volume, channel or turn the TV on and off.

This API is the exact same API that the "Sony Remote" app uses to control the TV.

Installation

For inclusion in another project, install through pip:

pip install py-sony-bravia-remote

Example usage

from sonybraviaremote import TV, TVConfig

# called the very first time you attempt to connect to your
# tv... the tv will display a pincode that you need to enter
# after the first connection attempt, you'll never have to do this again
def on_auth():
    return input('Pincode: ')

# ip address of your tv... the device name is the name under which
# your program will be registered... note that if you change the device
# name, you have to re-auth
config = TVConfig('192.168.0.23', 'my device name')
tv = TV.connect(config, on_auth)

tv.is_on() # true/false
tv.wake_up()
tv.power_off()
tv.netflix()
tv.home()
tv.enter()
tv.confirm()
tv.pause()
tv.play()
tv.confirm()
tv.mute()
tv.volume_up()
tv.volume_down()

py-sony-bravia-remote's People

Contributors

photonios avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

py-sony-bravia-remote's Issues

Exception when trying to create TV instance

>>> config = TVConfig('192.168.0.250', 'bravia')
>>> config
<sonybraviaremote.tvconfig.TVConfig object at 0x7fae6787b160>
>>> config.host
'192.168.0.250'
>>> tv = TV(config, on_auth)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/frutik/.local/lib/python3.5/site-packages/sonybraviaremote/tv.py", line 19, in __init__
    self._irc_codes = self.irc_codes()
  File "/home/frutik/.local/lib/python3.5/site-packages/sonybraviaremote/tv.py", line 32, in irc_codes
    url = 'http://%s/sony/system' % self.config.host
AttributeError: 'function' object has no attribute 'host'

Turn on?

Is there a way to turnOn the tv just like turnOff? Is that the wakeUp() command? Because it doesn't work for me. Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.