Giter Club home page Giter Club logo

pylgnetcast's Introduction

Patched version for use with cyrilic names cannel. For Russian users.

PyLgNetcast

A Python 3 library and command line tool to control LG Smart TV running NetCast 3.0 (LG Smart TV models released in 2012) and NetCast 4.0 (LG Smart TV models released in 2013) via TCP/IP.

Dependencies

pylgnetcast requires:

API Usage

from xml.etree import ElementTree
from pylgnetcast import LgNetCastClient, LG_COMMAND, LG_QUERY

with LgNetCastClient('192.168.1.5', '889955') as client:
    client.send_command(LG_COMMAND.MUTE_TOGGLE)
    data = client.query_data(LG_QUERY.VOLUME_INFO)
    if data:
        print(ElementTree.tostring(data[0], encoding='unicode'))

Command Line Tool

PyLgNetCast also provides a simple command line tool to remote control a TV.

The tool needs a pairing key to be allowed to send commands to your TV. To get the pairing key just start the tool while your TV is on:

python -m pylgnetcast --host <IP of your TV>

This will display the pairing key on your TV.

To retrieve status information from your TV start the tool like:

python -m pylgnetcast --host <IP of your TV>  --pairing_key <pairing key of your TV>

This will display information about the current channel, volume, 3D mode, etc. retrieved from your TV.

If you want to send a command to your TV, for instance to turn the volume up, check the list of available commands in the pylgnetcast.py file. The class LG_COMMAND defines all supported commands and volume up would be defined as 24.

python -m pylgnetcast --host <IP of your TV>  --pairing_key <pairing key of your TV> --command 24

pylgnetcast's People

Contributors

wokar avatar alryaz avatar tayanov avatar

Watchers

James Cloos avatar  avatar

Forkers

docorreas

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.