Git Product home page Git Product logo

lg-netcast-control's Introduction

LG Netcast TV API remote control

This repo is just a wrapper around the XML LG Netcast API that allows you to control your TV with external apps.

Why should I use it ?

The LG specification is a very basic XML API so you might wonder "Why would I need an API to use another API ??". Well, even if the LG api is simple, it forces you to deal with things like XML, authentication, pairing, etc.

With this wrapper, you can with very little configuration query your TV API with an HTTP request, without having to pass the correct headers, value, http status, etc.

Install

Edit config.json and replace ip value with your TV IP address

Run npm install and npm start

When the pairing code appears on your TV, update config.json with the given value

Then run npm start again and you're good to go.

Usage

Examples :

Action Command
List actions curl http://localhost:1234/commands/list
Mute curl -X POST http://localhost:1234/command/mute
Turn off curl -X POST http://localhost:1234/command/off
Volume UP curl -X POST http://localhost:1234/command/sound-plus
Volume DOWN curl -X POST http://localhost:1234/command/sound-minus
Left curl -X POST http://localhost:1234/command/left
Right curl -X POST http://localhost:1234/command/right

Well you've got the idea. See curl http://localhost:1234/commands/list to get the list of actions.

Create custom action flows

Add an express route, and see the "netflix" example. Basically, it's just about sending commands one after the other.

netflix(req, res) {
  API.command('home');
  setTimeout(() => API.command('right'), 4000);
  setTimeout(() => API.command('bottom'), 5500);
  setTimeout(() => API.command('ok'), 6500);
  res.sendStatus(200);
},

lg-netcast-control's People

Contributors

michaelvilleneuve avatar r0zbot avatar rogerioimperador avatar

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.